因此,在运行代码时会生成以下错误。 它表示用户代码不处理NameError。在
错误:
Traceback (most recent call last):
File "D:\3rd sem\Object Oriented Programming\Lab\VS\PythonApplication1\PythonApplication1\PythonApplication1.py", line 50, in <module>
main()
File "D:\3rd sem\Object Oriented Programming\Lab\VS\PythonApplication1\PythonApplication1\PythonApplication1.py", line 10, in main
grade=str(input("Enter the grade: "))
File "<string>", line 1, in <module>
NameError: name 'a' is not defined
代码是这样的:
^{pr2}$有人能帮忙解决问题吗。在
提前谢谢。在
您似乎在使用Python2.x,因此应该更改
到
^{pr2}$相关问题 更多 >
编程相关推荐