Function 2 working

I think I got the get_email function working here (I have 2 dots) but am
still getting one F as the result of the testing section. If this
function still has an error, I can come back and fix it before
completing checkpoint 1.
This commit is contained in:
Chris Mekelburg 2024-10-13 14:49:07 -04:00
parent dd1fb7d3d3
commit e4cb952f6f
1 changed files with 5 additions and 1 deletions

View File

@ -27,7 +27,11 @@ def get_email(people, name):
>>> get_email(friends, "Tad Winters")
None
"""
raise NotImplementedError()
for person in people:
if person["name"] == name:
return person["email"]
else:
return "None"
def count_favorite_colors(people, name):
"""Returns the number of colors liked by the named person. If there is no such person, returns None.