generated from mwc/lab_weather
completed the list of people who like a color and the number or people who like a color functions.
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user