我收到了这个错误。期望一个缩进的块。我该怎么办?

时间:2016-09-30 08:46:25

标签: python

def shut_down(s):

if s == "yes":
    return "Shutting down"
elif s == "no":
    return "Shutdown aborted"
else:
    return "Sorry"

1 个答案:

答案 0 :(得分:5)

好吧,你可以尝试放一个缩进的块,因为它说它期望一个缩进的块。

def shut_down(s):
    if s == "yes":
        return "Shutting down"
    elif s == "no":
        return "Shutdown aborted"
    else:
        return "Sorry"