What would be an elegant and pythonic way to implement cumsum? Alternatively - if there\'a already a built-in way to do it, that would be even better of course...
def cumsum(a): return map(lambda x: sum( a[0:x+1] ), range( 0, len(a) )) cumsum([1,2,3]) > [1, 3, 6]