From 47d2723a0a5aa8c606d1982949f813f220364605 Mon Sep 17 00:00:00 2001 From: Hope Date: Mon, 7 Jul 2025 20:14:28 -0400 Subject: [PATCH] completed the favorite colors count function --- friend_functions.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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.