Lesson 12 need help please


also please dont just give me your code that is not letting me learn
i need to learn so please help me out

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 error is
Oops, try again. The body of your function should not contain any references to 'n'


Try to remove this loop here:


its hard to help you when we dont know what the goal of the lesson is :confused:

is it this one? Printing out a list item by item in a function


it looks to me that there may be a bug in the automatic evaluation script. I'm having the same problem. Clearly there is no mention of variable n inside the function but the error says otherwise.


This worked, but it is not clear in the instructions that the original code must be moved inside the function. The instructions suggest that copying it would also work. but it doesn't


Yeah, they want you to put the existing code into your function, but you have to change the code so that it uses x as a parameter instead of directly referencing n.

Initially, I tried doing the following

def print_list(x):
    for y in x:
        print y
n = [3, 5, 7]

which does exactly the same thing (with a little more elegance, in my opinion), but it is not accepted as the answer.