2022-05-05 18:25:55 +02:00

10 lines
218 B
ReStructuredText

>>> import operator
>>> import itertools
# Sales per month
>>> months = [10, 8, 5, 7, 12, 10, 5, 8, 15, 3, 4, 2]
>>> list(itertools.accumulate(months, operator.add))
[10, 18, 23, 30, 42, 52, 57, 65, 80, 83, 87, 89]