diff --git a/friend_functions.py b/friend_functions.py index 2a3c313..1efb2e6 100644 --- a/friend_functions.py +++ b/friend_functions.py @@ -40,23 +40,6 @@ def count_favorite_colors(people, name): return None def people_who_like_color(people, color): - """Returns a list containing only those people who like the given color. - >>> people_who_like_color(family, "yellow") - [ - { - "name": "Walker Hurley", - "email": "auctor.odio@icloud.ca", - "favorite_colors": ["red", "yellow", "blue", "orange"], - }, - { - "name": "Clementine Joseph", - "email": "hendrerit@aol.co.uk", - "favorite_colors": ["yellow", "aqua", "black"], - } - ] - >>> people_who_like_color(family, "indigo") - [] - """ people_list = [] for person in people: for colors in person["favorite_colors"]: @@ -72,7 +55,11 @@ def count_people_who_like_color(people, color): >>> count_people_who_like_color(family, "orange") 1 """ - raise NotImplementedError() + people_liking_color = people_who_like_color(people,color) + people_count = 0 + for person in people_liking_color: + people_count = people_count + 1 + return people_count def get_color_dict(people): """Returns a dict showing how many people like each color.