best cumulative sum

Micah Elliott mde at micah.elliott.name
Mon Nov 21 07:45:08 CET 2005


On Nov 21, David Isaac wrote:
> What's the good way to produce a cumulative sum?

>>> import operator
>>> x = 1,2,3
>>> reduce(operator.add, x)
6

-- 
_ _     ___
|V|icah |- lliott             <><             mde at micah.elliott.name
" "     """



More information about the Python-list mailing list