Files
python/exercises/practice/accumulate/example.py

9 lines
150 B
Python
Raw Normal View History

2014-04-10 18:44:28 -03:00
# [op(x) for x in seq] would be nice but trivial
2015-11-11 00:14:30 +01:00
def accumulate(seq, op):
2014-04-10 18:44:28 -03:00
res = []
for el in seq:
res.append(op(el))
return res