`

python input 输出 “Name 'XXX' is not defined

 
阅读更多
names = input("Enter your name:")

Enter your name: tom
Traceback (most recent call last):
  File "/Users/xa/study/py_study1/test.py", line 1, in <module>
    names = input("Enter your name: ")
  File "<string>", line 1, in <module>
NameError: name 'tom' is not defined

其实是个很傻的问题 输入的时候要加上 "tom" 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics