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'

It print's the elements of the list properly, but I don't know what to do with the error message!

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]



you should have used the for loop provided in the function, you didn't, and that is okay, but then you need to get rid of the old loop:

# get rid of this loop
for i in range(0, len(n)):
    print n[i]


Thank you stetim94, It solved my problem.
I misunderstood like, I have to print it in both ways !!!