Review. Functions PLEASE HELP


it kept displaying this error message "Oops, try again. Your function failed on the message yes. It returned 'yes' when it should have returned 'Shutting down'" i don't know what to do

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


the function ends the moment a return keyword is reached, remove this line:

return s

for the obvious reason that it causes the function to end prematurely.


oh! Thanks. I think i need to learn more about the return fxn


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