Printing out a list item by item in a function


<Below this line, add a link to the EXACT exercise that you are stuck at.>

Why is this not working?


Replace this line with your code.
n = [3, 5, 7]

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

def print_list(x):
print x[i]
return x


<do not remove the three backticks above>


I finally managed to solve the exercise, but still don’t understand why my first code didn’t work :(:


the instructions say:

Use the existing code as a scaffold.

You have to convert the given code to a function. If you write new code, the provided code has to be removed, otherwise the exercise won’t approve it


Thanks a lot. I didn’t think about that.


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