How do i make it return shutdown instead of yes?


I'm stuck please help urgently.
I need it to return "shutdown aborted" instead of "yes" what should i change?

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


don't get to distracted by the example, it only shows syntax, your program has a different design

For starters, a function ends the moment a return keyword is reached. Guess where this happens?

the function parameter (s) will contain a string, so your if condition should be check if s equals "yes"


it still returns yes instead of shutting down


thank you got it. i just needed to scrub off the first return


everything works now?


yeah it works! :slight_smile: