Skip to content

Commit

Permalink
Update birthdays.py
Browse files Browse the repository at this point in the history
  • Loading branch information
cyai authored Jun 28, 2022
1 parent fc0e6ca commit fced060
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions birthdays.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
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.')
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.')

0 comments on commit fced060

Please sign in to comment.