2024-09-30 02:18:05 发布
网友
这是我一直在使用的代码,它只是不断出现错误,我使用的是Python2.7,建议或帮助会非常有用。我在努力
print "What is your mobile problem?" print "----------------------------" problem = raw_input if "dropped" in problem print "sdghsd" elif "broken" in problem print "sdfghf"
您的代码很好,唯一不断生成错误的是您忘记在if语句的末尾添加:
所以你的代码应该是这样的
print "What is your mobile problem?" print " " problem = raw_input() if "dropped" in problem: print "sdghsd" elif "broken" in problem: print "sdfghf"
对于python2,文档:https://docs.python.org/2/library/functions.html#raw_input)
if语句:https://docs.python.org/2/tutorial/controlflow.html
您的代码很好,唯一不断生成错误的是您忘记在if语句的末尾添加:
所以你的代码应该是这样的
对于python2,文档:https://docs.python.org/2/library/functions.html#raw_input)
if语句:https://docs.python.org/2/tutorial/controlflow.html
相关问题 更多 >
编程相关推荐