choice = raw_input("> ")
if choice == "smack it" or "kick it":
print "the tiger gets angrier and eats your head of"
exit(0)
elif choice == "offer it the beef" or "offer it beef" or "offer it the beef in my pocket":
print "the tiger enjoys the treat"
print "and lets you go to the next room"
bear_room
else:
print "the tiger smels the beef you have in you pocket and eats you"
exit(0)
但问题是,无论我输入什么原始输入,它只是执行就好像第一个if语句是真的并打印"老虎变得愤怒并且吃掉你的头。" 请帮我找到我的错误
答案 0 :(得分:1)
您应该将choice = raw_input("> ")
if choice == "smack it" or choice == "kick it":
print "the tiger gets angrier and eats your head of"
exit(0)
elif choice == "offer it the beef" or choice == "offer it beef" or choice == "offer it the beef in my pocket":
print "the tiger enjoys the treat"
print "and lets you go to the next room"
else:
print "the tiger smels the beef you have in you pocket and eats you"
exit(0)
添加到所有这些,而不仅仅是第一个。
<DataGridCell MouseEnter="DataGridCell_MouseEnter"/>