Help on 15/18. I am really confused


#1

Oops, try again. Your code looks a bit off. Check the console window for errors!

n = [3, 5, 7]

def total(numbers):
result = 0
for i in numbers:
i.append(result)
return result

Can anyone help? I'm really confused.
Everything is indented properly.


#3

I'm not an expert, but why do you append in variable? There are much easier ways, for example you can just set variable to be the sum of variable itself and a list. If you still confused, this code should do the trick:

for i in numbers:
        result = result + i

#4

def total(numbers):
result = 0
for item in numbers:
result = item + result
return result