17. Review: Functions Help


#1

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

I have this code and it keeps telling me. Please help.
File "python", line 4
elif s == "no":
^
SyntaxError: invalid syntax


#2

with the right indentation your code works

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

#3

Python is rather fussy when it comes to indentation so be careful when making if/else statements, functions, loops and so on.