action = raw_input("Choose a letter> ")
if action == "a" or "A":
dead("Well this feels good, \nI think I'll just sit here forever like this.")
elif action == "b" or "B":
god_appearance("God says: Cool, you need some help?")
elif action == "c" or "C":
success()
else:
not_an_option()
无论raw_input,函数dead()都会返回。但是,当我在没有"或"的情况下运行相同的代码时语句,if语句返回预期的函数。例如:
if action == "a":
dead("Well this feels good, \nI think I'll just sit here forever like this.")
elif action == "b":
god_appearance("God says: Cool, you need some help?")
elif action == "c":
success("You win the three wolves and a moon t-shirt!")
else:
not_an_option()
为什么?提前谢谢!