diff --git a/friend_functions.py b/friend_functions.py index b001762..c4d1fe7 100644 --- a/friend_functions.py +++ b/friend_functions.py @@ -72,7 +72,7 @@ def people_who_like_color(people, color): [] """ raise NotImplementedError() - + def count_people_who_like_color(people, color): """Returns the number of people who like a given color. @@ -81,7 +81,11 @@ def count_people_who_like_color(people, color): >>> count_people_who_like_color(family, "orange") 1 """ - raise NotImplementedError() + how_many_like_color = 0 + for person in people: + if color in person["favorite_colors"]: + how_many_like_color = how_many_like_color + 1 + return how_many_like_color def get_color_dict(people): """Returns a dict showing how many people like each color.