Review Functions: this what is says File "python", line 3 return "Shutting down" ^ IndentationError: expected an indented block


#1

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

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

else:
    return "Sorry"

#2

Problem1.
Indent your code.

Problem2

elif:
    s == "no":

hint**

elif condition:
    #your code!

#3

I did fix it there but look what it says now

File "python", line 3
return "Shutting down"
^
IndentationError: expected an indented block


#4

Indent your code...when a new block starts it should be indented..

example...

def AnyFunc(y):
    if y == 2:
        return y * 3

indent it by 4 spaces.


#5

Thanks I got it...I just had to indent the code from def to the last Return statement, help much appreciated


#6

Cheers!!... :thumbsup:


#7

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.