This must be trivial.
I want to calculate the following.
100*((1 + r)**n), for n = 0, 1, 2, ..., N
I used the following.
>>> list(itertools.accumulate([c0, range(5)], lambda w,r: w*(1.02**r)))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 1, in <lambda>
TypeError: unsupported operand type(s) for ** or pow(): 'float' and 'range'```
c0represent in your code?