Iterating over a list in a function


my code here:

n = [3, 5, 7]

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

it keeps on loading, what am I doing wrong here? please help!



for i in range(len(list)):

where is list defined? And why are you looping over list?


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.