n = [3, 5, 7]

def total(numbers):

result = 0

for i in range(len(numbers)):

numbers[i] = numbers[i] + result

return result

n = [3, 5, 7]

def total(numbers):

result = 0

for i in range(len(numbers)):

numbers[i] = numbers[i] + result

return result

You dun goofed.

n = [3, 5, 7]

def total(numbers):

result = 0

for i in range(len(numbers)):

numbers[i] = numbers[i] + result

return result

where it says numbers[i] = numbers[i] + result, it SHOULD BE result += numbers[i] (use your method for increment I like +=)

Working code :

n = [3, 5, 7]

def total(numbers):

result = 0

for i in range(len(numbers)):

result += numbers[i]

`return result`

**For Method 1**

```
n = [3, 5, 7]
def total (numbers):
result = 0
for item in numbers:
result += item
return result
print total(n)
```

**For Method 2**

```
n = [3, 5, 7]
def total (numbers):
result = 0
for i in range(0,len(numbers)):
result += numbers[i]
return result
print total(n)
```

you should notice this in for structure: result = numbers[i] + result, **not** numbers[i] = numbers[i] + result

The ** result += numbers [i]** is just a shortcut for

it allows you to save some time, and makes your code smaller.