17.Functions


#1

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

this was the code I inputed and it came up with the indention error-help please!


#2

The entire block needs to be indented inside the function:

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

Notice that the highlighting indicates an error, still. That would be the missing quote on line 3.


#5

A post was split to a new topic: Did you remember to print?


#6