diff --git a/friend_functions.py b/friend_functions.py index b7cc1c0..f68cdbe 100644 --- a/friend_functions.py +++ b/friend_functions.py @@ -30,7 +30,11 @@ def count_favorite_colors(people, name): >>> count_favorite_colors(family, "Raphael Chambers") 1 """ - raise NotImplementedError() + for person in people: + if person.get("name") == name: + fav_colors = len(person.get("favorite_colors")) + return fav_colors + return None def people_who_like_color(people, color): """Returns a list containing only those people who like the given color.