How do i make it return shutdown instead of yes?


#1

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

#2

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"


#3

it still returns yes instead of shutting down


#4

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


#5

everything works now?


#6

yeah it works! :slight_smile:


#7