Printing out a list item by item in a function


#1



https://www.codecademy.com/en/courses/python-beginner-nzzVa/3/1?curriculum_id=4f89dab3d788890003000096


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]

print_list(n)


#2

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]

#3

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


#4