diff --git a/friend_functions.py b/friend_functions.py index f5757aa..d64b0d6 100644 --- a/friend_functions.py +++ b/friend_functions.py @@ -9,6 +9,8 @@ # Your job is to complete these functions. Remove the NotImplementedError from # each and instead write code which returns the expected values. +from people import friends, family + def count_people(people): """Counts the number of people. @@ -23,14 +25,9 @@ def count_people(people): return counted def get_email(people, name): - """Returns the named person's email address. If there is no such person, returns None. - - >>> get_email(family, "Tad Winters") - "ligula.aenean@hotmail.edu" - >>> get_email(friends, "Tad Winters") - None - """ - raise NotImplementedError() + for person in people: + if person["name"] == name: + return person["email"] def count_favorite_colors(people, name): """Returns the number of colors liked by the named person. If there is no such person, returns None. diff --git a/friend_functions.pyc b/friend_functions.pyc index 8507c16..8704c09 100644 Binary files a/friend_functions.pyc and b/friend_functions.pyc differ