From 847c416f3a32040908c188dfdc70ff759dbf568d Mon Sep 17 00:00:00 2001 From: Hope Date: Mon, 7 Jul 2025 20:45:48 -0400 Subject: [PATCH] completed the list of people who like a color and the number or people who like a color functions. --- friend_functions.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/friend_functions.py b/friend_functions.py index f68cdbe..20653e4 100644 --- a/friend_functions.py +++ b/friend_functions.py @@ -54,7 +54,8 @@ def people_who_like_color(people, color): >>> people_who_like_color(family, "indigo") [] """ - raise NotImplementedError() + return [person for person in people if color in person.get("favorite_colors", [])] + def count_people_who_like_color(people, color): """Returns the number of people who like a given color. @@ -64,7 +65,7 @@ def count_people_who_like_color(people, color): >>> count_people_who_like_color(family, "orange") 1 """ - raise NotImplementedError() + return len(people_who_like_color(people,color)) def get_color_dict(people): """Returns a dict showing how many people like each color.