I don't know what to do.why it doesn't work?


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


It isn't indented, indentation is part of the language so it needs to be included both when running the code and when showing the code to others.

Aside from that, what do you mean by that it doesn't work? Can you describe that in terms of what it does differently from what you want it to do? The word "work" doesn't carry that information.


How about this?

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


you have a return statement before the if statements. The compiler will "leave the function" once something has been returned.