Printing out a list item by item in a function


#1



Hi,
I am working on an exercise "Printing out a list item by item in a function".
I have put the below code.

n = [3, 5, 7]

for i in range(0, len(n)):
    print n[i]
    
def print_list(x):
    for j in range(0, len(x)):
        print x[j]
        
print print_list(n)

I am unable to understand what is wrong in this. It thows an error saying

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

`


#2

i just explained this problem here:

Please read it


#3

Thanks for the help. The error that was being displayed was misleading. However, I got it cleared now.


#4