I'm trying to create a function that takes a list as an argument and then gives back a new list with the cumulative sum of that list. For example:
l = [1, 7, -3, 9, -2]
would become:
[1, 8, 5, 14, 12]
I am also trying to use a for
loop for this function.