所以我正在尝试编写游戏代码并且我正在尝试连接关卡的不同区域。这部分代码应该允许用户选择进入关卡但终端不断给我这个错误命令:"expected an indented block"
.
我试图用四个空格替换所有选项卡,反之亦然,但错误不会消失。
顺便说一句,我知道在定义一个函数之后,每一行都会缩进四个空格或一个制表符,但这是我的第一个问题,我不知道如何在这里做到这一点。
def entry_hall():
first = raw_input("Go upstairs\nGo forwards\nGo left\nLeave\n:")
if first == "Go upstairs" or "upstairs":
print "Walking up the stairs"
import Upstairs_hallway.py
elif first == "Go forwards" or "forwards":
pass
elif first == "Go left" or "left":
pass
elif first == "Leave":
print """
You're a cop. You are not a baby. Do something else
"""
#restart the script
entry_hall()