generated from mwc/lab_weather
completed the favorite colors count function
This commit is contained in:
parent
8d781af461
commit
47d2723a0a
|
@ -30,7 +30,11 @@ def count_favorite_colors(people, name):
|
||||||
>>> count_favorite_colors(family, "Raphael Chambers")
|
>>> count_favorite_colors(family, "Raphael Chambers")
|
||||||
1
|
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):
|
def people_who_like_color(people, color):
|
||||||
"""Returns a list containing only those people who like the given color.
|
"""Returns a list containing only those people who like the given color.
|
||||||
|
|
Loading…
Reference in New Issue