renamed files
[babynames_answers] / challenge_7.py
1 # 7. Write a program that will take a name as input and return the number of
2 #    girls and boys with that name.
3
4 import ssadata
5
6 name = input("Input a name: ")
7
8 if name in ssadata.boys.keys():
9     print("There are " + str(ssadata.boys[name]) + " boys named " + name)
10 else:
11     print("There are 0 boys named " + name)
12
13 if name in ssadata.girls.keys():
14     print("There are " + str(ssadata.girls[name]) + " girls named " + name)
15 else:
16     print("There are 0 girls named " + name)
17

Benjamin Mako Hill || Want to submit a patch?