Stuck in 17:Review Functions


Hi! I am currently stuck!

17: Review Functions.

I keep getting the following error message:
Oops, try again. Your function failed on the message yes. It returned 'yes' when it should have returned 'Shutting down'

Can anyone tell me what is wrong with my code????

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

Any help would be appreciated! Thank you!


I just changed the quotes from single to double quotes.

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


I just found the problem based on other discussions!

I had to remove the following line: return(s)


Thanks! It worked when I removed the line...return(s).


I don't think there is a difference in either single or double quotes really.

But if you look at the instruction, it says to use return but with the return and condition string in double quotation.

Good that what you did worked.


There is not difference unless you mix them


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