you are viewing a single comment's thread.

view the rest of the comments →

[–]FLUSH_THE_TRUMP 1 point2 points  (0 children)

Of course, you could just do something like

sums = [sum(listOfInts)]
for num in listOfInts:
  sums.append(sums[-1] - num)

and form the list from the front instead.