Printing out a list item by item in a function


#1



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


The body of your function should not contain any references to 'n'.


In the hint tab it says to add lines 3 and 4 from the editor to within the function and to indent properly but it seems there is some problem.


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

print_list(n)


#2

The solution to this problem is if haven't used the snippet of code in lines 3 and 4 and if you wrote your own copy of it erase lines 3 and 4. Or you can just define your function on line 2 and continue with rest.


#3

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