def cumsum(seq):
    s = seq[0]
for k in range(1, len(seq)):
    yield s
s = s + seq[k]
yield s
print([c for c in cumsum(list(range(7)))])
print([c for c in cumsum((0, 1, 2, 3, 4, 5, 6))])
print([c for c in cumsum(['a', 'b', 'c'])])
print([c for c in cumsum([['a'], ['b'], ['c']])])
print([c for c in cumsum((('a',), ('b',), ('c',)))])
What's wrong with this cumulative sum?