Iterating over a list in a function


Keep getting the error message: Oops, try again. total([0, 3, 6]) returned 3 instead of 9

I think my problem is that i'm setting the function to terminate at len(numbers) and so it's not including the last number in the list, 6. I have no idea how to fix this though.

I have quadruple checked my indentation but it could also be this.
Any help would be greatly appreciated so I can advance!

def total(numbers):
    for number in range(0,len(numbers)):
    return result



for number in range(0,len(numbers)):

using range() will give you the indexes for your numbers list, so either use the indexes range give you to retrieve values from your numbers list and add them to result, or don't use range at all, which give you direct access to values in numbers list


Thank you for your help!