def cumsum(iterable):
    iterable = iter(iterable)
s = next(iterable)
yield s
for c in iterable:
    s = s + c
yield s
tests = [[], [1], [1, 2], list(range(7)), (0, 1, 2, 3, 4, 5, 6), ['a', 'b', 'c'],
    [['a'], ['b'], ['c']], (('a',), ('b',), ('c',)), range(7)]
for test in tests:
    pass
What's wrong with this cumulative sum?