python d中的错误未定义。我正在学习python并且有这个错误。我可以知道代码中的错误在哪里。File "<string>", line 1, in <module>.Name = ""Desc = ""Gender = ""Race = ""# Prompt user for user-defined informationName = input('What is your Name? ')
Desc = input('Describe yourself: ')当我运行程序时它输出你的名字是什么?(i投入d)这就给出了错误Traceback (most recent call last):
File "/python/chargen.py", line 19, in <module>
Name = input('What is your Name? ')
File "<string>", line 1, in <module>NameError: name 'd' is not defined这是Python 3中为绝对初学者编写的示例代码。
3 回答
qq_笑_17
TA贡献1818条经验 获得超7个赞
input
eval
input()
python
~$ pythonPython 2.6.5 (r265:79063, Apr 5 2010, 00:18:33) [GCC 4.2.1 (Apple Inc. build 5659)] on darwinType "help", "copyright", "credits" or "license" for more information.>>>
python3.1
:
~$ python3.1Python 3.1.1 (r311:74480, Jan 25 2010, 15:23:53) [GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwinType "help", "copyright", "credits" or "license" for more information.>>>
慕码人8056858
TA贡献1803条经验 获得超6个赞
input()
raw_input()
input()
Name = raw_input("What is your Name? ")
添加回答
举报
0/150
提交
取消