Skip to content

Instantly share code, notes, and snippets.

@chipoglesby
Last active February 13, 2016 19:10
Show Gist options
  • Save chipoglesby/3fca169e3ca86c86aa01 to your computer and use it in GitHub Desktop.
Save chipoglesby/3fca169e3ca86c86aa01 to your computer and use it in GitHub Desktop.
Answer the door! A quick gist to show how a computer program would walk through the process of answering the door as if it were human.
def answer_door():
print "The doorbell rings and you open the door"
print "Is this someone that you know?"
answer = raw_input("Answer Yes No or Sketchy.").lower()
if answer == "yes":
print "Hey friend! How's it going? It's so great to see you again!"
elif answer == "no":
print "Oh, hello I do not think we've met before. How can I help you?"
else:
print "It's probably a bill collector! Shut the door!"
answer_door()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment