我在调试这段为家庭作业编写的代码时遇到了一些问题。它完美地遵循了示例代码(据我所知),但是当我回答“塞尔达传奇:时间的陶笛”和“当我回答gtav解析消息时意外的EOF”时,它出现了语法错误
game = input("What is the best game ever made?: ")
if game == "Legend of Zelda: Ocarina of Time":
print ("Top rated")
elif game == "GTA V":
print ("YES!")
else:
print ("That doesn't compare to GTA V of Ocarina of Time")
应该是
您可能从python3教程中获得了示例代码。在python2中,
input
被称为raw_input
,input
是一个非常无用的函数,它做了其他的事情。你知道吗另外,如果可以的话,现在可以使用python3。你知道吗
相关问题 更多 >
编程相关推荐