Printing out a list item by item in a function


#1



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

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


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


#2

I just ran your code:

n = [3, 5, 7]


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

I got the output:

3
5
7
None

Please could you try browser refresh?


#3

i have done that still get this error


#4

Remove the code on lines 3-4. Needless.

Hope this now resolves :slight_smile:


#5

thank you bro keep it up :slight_smile:


#6

You're welcome.

[Not sure how you know I am a guy]

Code on! :slight_smile:


#7

sorry :sweat: !!! :joy:


#8

Haha... It's fine! :smile: :wink:


#9

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