diff --git a/friend_functions.py b/friend_functions.py index 938a785..b001762 100644 --- a/friend_functions.py +++ b/friend_functions.py @@ -44,7 +44,14 @@ def count_favorite_colors(people, name): >>> count_favorite_colors(family, "Raphael Chambers") 1 """ - raise NotImplementedError() + num_fave_colors = 0 + for person in people: + if person["name"] == name: + for color in person["favorite_colors"]: + num_fav_colors = num_fav_colors + 1 + return num_fav_colors + else: + return None def people_who_like_color(people, color): """Returns a list containing only those people who like the given color.