Skip to content

Instantly share code, notes, and snippets.

@shamikalashawn
Created February 2, 2017 23:14
Show Gist options
  • Save shamikalashawn/f302d2a6315b3db37bc58bfe08e73dc6 to your computer and use it in GitHub Desktop.
Save shamikalashawn/f302d2a6315b3db37bc58bfe08e73dc6 to your computer and use it in GitHub Desktop.
A database of birthdays can be queried or added to.
birthdays = {'Alice': 'Apr 1', 'Bob': 'Dec 12', 'Carol': 'Mar 4'}
while True:
print('Enter a name: (blank to quit)')
name = input()
if name == '':
break
if name in birthdays:
print(birthdays[name] + ' is the birthday of ' + name)
else:
print('I do not have birthday information for ' + name)
print('What is their birthday?')
bday = input()
birthdays[name] = bday
print('Birthday database updated.')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment