To clarify, my original list contains the difference between two consecutive values, starting from zero. I want to convert this list to a list of actual values using a functional style, without having to keep a global state during calculation, without for loops, using map, reduce, etc.
my_list = [0, 1, 0, 3, 2, 0, 0, 2, 1]
result = my_function(my_list)
print(result)
[0, 1, 1, 4, 6, 6, 6, 8, 9]