Home > database >  Python conditional sum more, very interesting question, ask god help me
Python conditional sum more, very interesting question, ask god help me

Time:10-21

A list list_1 has n elements, are digital, and now I want to draw arbitrary number of elements in a list of the value of the sum (for example, take two elements both two sum first, then take three elements sum... Has been to remove n elements sum up),

For example: list_1=[1, 2, 3]
I want:
Sum=,4,5,6 [3]

Great god guide, respectively with violence cycle and no violence cycle way of solving!!!!!!

Don't know Python posts should be in which area, a great god, o grab a plate to do not abandon me ~

CodePudding user response:

Come on top, a great god!!!!!!
  • Related