12/18 Printing out a list item by item in a function


n = [3, 5, 7]

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

#for i in range(0, len(n)):

print n[i]

Replace this line with your code.


Error Message:

The body of your function should not contain any references to ‘n’


this code:

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

was provided as scaffold, you wrote new code for your function (and not converting the existing code into a function), which is fine, but then you have to remove the scaffold, otherwise you get this error


Thanks man it worked. I have a question What exactly scaffolding means . I searched in internet didn’t find a convincing answer.


Scaffolding is some code that they give you that is formatted correctly but it needs to be altered in terms of variable names etc. in order to apply properly to the task


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