Is it possible to have something like:
list1 = ... currentValue = 0 list2 = [currentValue += i, i for i in list1]
I tried that but didn\'t wor
Here's an example from another question:
[i for i,x in enumerate(testlist) if x == 1]
the enumerate generator returns a 2-tuple which goes into i,x.