Help: Review: functions - what is wrong with my code?


When i click "save and submit" i get this error message:
Oops, try again. Did you create a function called shut_down?

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


yes and no are undefined variable, are you certain this should be variables?

i found this code :

def shut_down(reply):
     reply = reply.upper()
     if reply == "YES":
          msg = "Shutting down..."
     elif reply == "NO":
          msg = "Shutdown aborted!"
            msg = "Sorry, I didn't understand you."
     return msg


see how yes and no are strings in this code? This important to see and understand


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