15/18 Method 2


I finished this exercise using method 1, but I would like to get it with method 2 as well and I can't figure out where I am going wrong.

n = [3, 5, 7]

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

If someone could help me out I would appreciate it. :slightly_smiling:

I Figured it out, I needed to get rid of one of the tabs before return


You return before finishing your loop