generated from mwc/lab_weather
Created a function that returned a list so we had to start out with result to = [] and then work throught the dictionary to get the final output. Used the append command that was used in the scatter lab to create the list! created a for statement to help get the information we needed!
This commit is contained in:
@@ -64,7 +64,11 @@ def people_who_like_color(people, color):
|
||||
>>> people_who_like_color(family, "indigo")
|
||||
[]
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
result = []
|
||||
for person in people:
|
||||
if color in person["favorite_colors"]:
|
||||
result.append(person)
|
||||
return result
|
||||
|
||||
def count_people_who_like_color(people, color):
|
||||
"""Returns the number of people who like a given color.
|
||||
|
||||
Reference in New Issue
Block a user