1 # 2. Are there more boys names or girls names? What about for particular
2 # letters? What about for every letter?
6 num_boys_names = len(ssadata.boys)
7 num_girls_names = len(ssadata.girls)
9 print("total boy names: " + str(num_boys_names))
10 print("total girl names: " + str(num_girls_names))
12 for letter in "abcdefghijklmnopqrstuvwxyz":
15 for name in ssadata.boys.keys():
16 first_letter = name[0]
17 if first_letter == letter:
18 count_boys = count_boys + 1
20 for name in ssadata.girls.keys():
21 first_letter = name[0]
22 if first_letter == letter:
23 count_girls = count_girls + 1
25 if count_boys == count_girls:
26 print(letter + ": the same number of boys names and girls names")
27 elif count_boys > count_girls:
28 print(letter + ": more boys names than girls names")
30 print(letter + ": more girls names than boys names")