Delete Icon
This forum is now read-only. Please use our new forums at discuss.codecademy.com.
0 points
Submitted by 12700
6 years ago

IndentationError: expected an indented block ???

def shut_down(s):

if s == “yes”: return “Shutting down”

elif s == “no”: return “Shutdown aborted”

else: return “Sorry”

Probably extremely obvious but i just cant see it? comes up as :

File “python”, line 3 if s == “yes”: ^ IndentationError: expected an indented block

p.s there are indentations on the three returns.

Answer 54248a237c82ca616900014b

1 vote

Permalink

Have you indented the if-statement, elif and else. And then indented the return inside there again. Like this:

def shut_down(s):
    if s == "yes":
        return "Shutting down"

    elif s == "no":
        return "Shutdown aborted"

    else:
        return "Sorry"
814 points
Submitted by Watakani
6 years ago

1 comments

12700 6 years ago

Thank you so much! I forgot to indent the if, elsif, and else. seems so simple now, thank you!!