"Oops, try again. total([0, 3, 6]) returned 0 instead of 9" is what's returned but I can't find my mistakes, please help


n = [3, 5, 7]

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




Can you tell me where did you define variable i?


Hi you should not put the return statement inside the for loop bu inside the function total

@miniapple8888 he used it inside the for loop



Ahh I see now! :sweat_smile: Thanks for pointing that out. I was too focused on the return statement. :wink:


Problem solved, thanks for the feedback!