the code works. i got it to work by trying different things. i just dont understand the line i created..... lol
for x in range(len(numbers)):
i understand x will go through the whole list and numbers is part of the function. i don't see why i needed range and len.
if you could explain whats going on and why i needed it to make my function work i would be most appreciative
at do you expect to happen instead?>
n = [3, 5, 7] def total(numbers): result = 0 for x in range(len(numbers)): result = numbers[x] + result return result print total(n)