在我的 python 程序中,有时在我的 if 语句中只有最上面的一个有效
这是我的程序 http://ubuntuone.com/0u2NxROueIm9oLW9uQVXra
当你运行程序时,如果你去东西南北,然后它不起作用,问题出在功能室4()中:
def room4():
"""Forest go south to small town room 1 and east to forest path room8"""
room = 4
print "Forest you can go south to small town, east to forest path, or continue to explore the forest"
cmd = raw_input('> ')
cmd = cmd.lower()
if cmd == "e" or cmd == "east" or "go east":
print room8()
if cmd == "s" or cmd == "south" or "go south":
print room1()
if cmd == "forest" or cmd == "explore" or cmd == "explore forest" or cmd == "explore the forest":
print room13()
else:
print error()
print room4()