generated from mwc/lab_weather
For function 3, it was similar to function 2 but we wanted the count so used the len command from function 1.
This commit is contained in:
@@ -41,7 +41,10 @@ def count_favorite_colors(people, name):
|
||||
>>> count_favorite_colors(family, "Raphael Chambers")
|
||||
1
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
for person in people:
|
||||
if person["name"] == name:
|
||||
return len(person["favorite_colors"])
|
||||
return None
|
||||
|
||||
def people_who_like_color(people, color):
|
||||
"""Returns a list containing only those people who like the given color.
|
||||
|
||||
Reference in New Issue
Block a user