https://www.codecademy.com/courses/python-beginner-nzzVa/3/4?curriculum_id=4f89dab3d788890003000096

I was trying out both methods for iterating. The first method I did yields the correct answer and it's as follows:

n = [3, 5, 7]

def total(numbers):

-result = 0

-for i in numbers:

--result = result + i

-return result

print total(n)

But when I try the second method the numbers don't seem to add up. Here's the code:

n = [3, 5, 7]

def total(numbers):

result = 0

-for i in range(len(numbers)):

--result = result + i

-return result

print total(n)

I get an error saying (Oops, try again. total([0, 3, 6]) returned 3 instead of 9).

Shouldn't the code range(len(numbers)) equal range(0,2) in this case and it should iterate through all the three numbers to return a sum? Gosh I'm so confused...

Thanks guys, any help is great!

`Replace this line with your code.`