Quotes help make search much faster. Example: "Practice Makes Perfect"

Sunday, November 25, 2012

Codecademy "Review: Functions"


#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?"))

1 comment:

  1. This does not work. This is the correct code:

    def shut_down (s):
    if s.upper() == "YES":
    return "Shutting down"
    elif s.upper() == "NO":
    return "Shutdown aborted"
    else:
    return "Sorry"

    ReplyDelete


This is an example of scrolling text using Javascript.

Popular Posts