Printing out a list item by item in a function. [The body of your function should not contain any references to 'n']


#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'


n = [3, 5, 7]

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

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

print_list(n)


#2

Remove this for loop and your code will work.:slight_smile:


#3

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