I have the following list:
myList = [5,15,23,45,2,43]
I want to create a running total in a new list, so it would look like:
newList = [20,43,88,90,133]
How would I do this?
try this:
newList = [sum(myList[:i+1]) for i in range(len(myList))][1:]