diff --git a/friend_functions.py b/friend_functions.py index 9b75faf..938a785 100644 --- a/friend_functions.py +++ b/friend_functions.py @@ -22,7 +22,6 @@ def count_people(people): count = count + 1 return count - def get_email(people, name): """Returns the named person's email address. If there is no such person, returns None. @@ -31,7 +30,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.