#sample solution
def shut_down(s):
if s == "Yes" or s == "yes" or s == "YES":
return "Shutting down..."
elif s == "No" or s == "no" or s == "NO":
return "Shutdown aborted!"
else:
return "Sorry, I didn't understand you."
print shut_down(raw_input("Do you want to shut down?"))
This does not work. This is the correct code:
ReplyDeletedef shut_down (s):
if s.upper() == "YES":
return "Shutting down"
elif s.upper() == "NO":
return "Shutdown aborted"
else:
return "Sorry"