Made function to tally favorite colors.

This commit is contained in:
tgaeta
2025-10-08 13:20:52 -04:00
parent 0e04bc4dba
commit 8f4fb6a4d9
2 changed files with 8 additions and 1 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -91,7 +91,14 @@ def get_color_dict(people):
"orange": 1, "orange": 1,
} }
""" """
raise NotImplementedError() color_count = dict()
for person in people:
for color in person["favorite_colors"]:
if color not in color_count:
color_count[color] = 0
color_count[color] += 1
return color_count