Printing out a list by item in a function


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

It should work i think

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]


the loop provided by the exercise is what you should have used in the function

you wrote a new loop, that is fine, but then you have to get rid of the old one


Thanks a lot, that works!