python d中的錯誤未定義。我正在學(xué)習(xí)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: ')當(dāng)我運行程序時它輸出你的名字是什么?(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中為絕對初學(xué)者編寫的示例代碼。
3 回答

qq_笑_17
TA貢獻1818條經(jīng)驗 獲得超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條經(jīng)驗 獲得超6個贊
input()
raw_input()
input()
Name = raw_input("What is your Name? ")
添加回答
舉報
0/150
提交
取消