Review. Functions PLEASE HELP


#1




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"
        
        else:
            return "sorry"


#2

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.


#3

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


#4

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