<分区> 分区>
我是 Python 的新手,一直在尝试制作一个小型测试游戏,但是当我在 CMD 中运行我的程序时,它给出了这个错误。
What Is Your Name?
Test
Traceback (most recent call last):
File "C:\Users\User\Documents\Python Games\Test.py", line 2, in <module>
myName = input()
File "<string>", line 1, in <module>
NameError: name 'Test' is not defined
虽然这在 IDLE 中工作正常。这是代码的顶部。
print('What Is Your Name?')
myName = input()
print('Hello '+str(myName)+' It is good to meet you!')
