Instructions
01.Define a function called print_list that has one argument called x.
02.Inside that function, print out each element one by one. Use the existing code as a scaffold.
03.Then call your function with the argument n.
原来的代码是:
n = [3, 5, 7]
for i in range(0, len(n)):
print n[i]
根据题目要求写的代码:
n = [3, 5, 7]
for i in range(0, len(n)):
print n[i]
def print_list(x):
for i in range(0,len(x)):
print x[i]
print_list(n)
不知哪里出错了,显示:The body of your function should not contain any references to 'n'
牧羊人nacy
GCT1015
相关分类