Returning yes instead of shut down


Continuing the discussion from I don't know what I'm doing wrong:

def shut_down(s):
return s

if (s=="Yes"):
     return "Shutting Down"
elif (s=="No"):
    return "Shut down aborted"
    return "sorry"


Your function failed on the message yes. It returned 'yes' when it should have returned 'Shutting down'

I've tried a bunch of different combos but I don't now what's wrong


Hi in this lesson I don't know why but you code should be like that before your if , else if and else try to put one space and fo the return a tab
a tab is the equivalent of four space so your code should be like that with inedent

def shut_down(s):

 if s=="yes":
    return "Shutting Down"
 elif s=="no":
    return "Shutdown aborted"
    return "Sorry"


This line is exiting the function before any code has been run. It may be removed.

We don't have to use parentheses on if condtionals:

if s == "Yes"
elif s == "No"


Make sure you calling 'return "Shutting down"' when calling shut_down with 'yes'.

Now it's giving me this error.


What I meant was to change those two lines.

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

I'm not on the lesson so check the instructions for exact phrases, and be sure we are following the instructions.