I Have checked other questions similar to this but none of them seem to answer my problem. I need to write a function that returns the cumulative sum of a list of number. I have this but it doesn't seem to work properly:
numbers = [4,3,6]
sums = []
def cumulativeSum(numbers):
for i in range(len(numbers) - 1):
sums.append(numbers[i] + numbers[i + 1])
return sums
print cumulativeSum(numbers) ##[4, 7, 13] What the answers should come out to be