Created
February 2, 2017 23:14
-
-
Save shamikalashawn/f302d2a6315b3db37bc58bfe08e73dc6 to your computer and use it in GitHub Desktop.
A database of birthdays can be queried or added to.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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