Fixed some more things with the other functions, still have to do the

get_color_dict.

I'm not sure why get_color_dict is not working, but I think that it is
not adding to the frequency when it encounters a second person with
the color in their favorites, because it is showing 1 instead of 2 for
some.
This commit is contained in:
root 2024-10-14 11:58:42 -04:00
parent 0119963833
commit 010dd82161
1 changed files with 11 additions and 7 deletions

View File

@ -108,8 +108,12 @@ def get_color_dict(people):
"orange": 1,
}
"""
raise NotImplementedError()
color_dict = {}
freq = 0
for person in people:
for fav_color in person["favorite_colors"]:
color_dict[fav_color] = freq + 1
return color_dict