Codecademy上python的一道问题卡住了

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'

阅读 5k
2 个回答

好吧 - -!我总算看懂了,要把
for i in range(0, len(n)): print n[i]
删掉。是我太......

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题