我试图在python 3.4版本中运行此函数。
tries = 0
answer = "Watson"
while(tries <= 3):
print("What is the name of the computer that played on Jeopardy?")
response = raw_input()
tries = tries + 1
if (response == "Watson"):
print("That is right!")
break;
elif (tries == 3):
print("Sorry. The answer is Watson.")
break;
else:
print("Sorry. Try again.")
我收到错误:
NameError: name 'raw_input' is not defined
我是否需要为python版本3.4做一些不同的事情
答案 0 :(得分:1)