Is this a bug? I can't continue


The error message I receive is:
Oops, try again. The body of your function should not contain any references to 'n'

I expect that I shouldn't receive any error messages, and that the code should work perfectly.

Here is an image of the error message:

n = [3, 5, 7]

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


def print_list(x):
    for a in x:


Try calling print_list(n) after defining the function rather than before.


Thanks for the quick reply!

I tried that as well, but I'm still getting the same error:


Is the initial for-loop supposed to be there still?


I think the problem is in the position of the defined function. Why don't you try defining the function after the list and thereafter code the for loop? I think that's simply it.


I believe so. I tried commenting it out, but I still run into the same error:


Thanks for the idea. However, I still run into the same error:


I've found a solution. I just changed the function to more closely resemble the for loop that was given, and removed the previous for loop.Thanks everyone for your help!

Keeping the for loop there, it has the similar previous error:


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