Printing out a list item by item in a function


Oops, try again. The body of your function should not contain any references to 'n'

I don't have any reference to n in my function, so WTF? :frowning:

n = [3, 5, 7]

for i in range(0, len(n)):
    print n[i]
def print_list(x):
    for i in range(0,len(x)):
        print x[i]


They are referring to this above your function. Best to remove that since it's a repetition of what's in your function.


Oh okay. That was confusing. Thank you!


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