I would like to create a function that sums first two elements and so on. Like:
arr = [1, 2, 3, 4, 5, 6, 7, 8, 9]
result = [3, 5, 7, 9, 11, 13, 15, 17]
I did something like that but got no results
def Consec_Sum(arr):
result = []
for i in range(len(arr)-1):
result = result.append(arr[i]+arr[i+1])
return result