generated from mwc/lab_weather
made change to fix else/return None problem
I removed the
else:
return None
and replaced with
return None
as discussed on Discord. I checked the code with test_friend_functions.py
and it all still works.
This commit is contained in:
@@ -30,8 +30,7 @@ def get_email(people, name):
|
|||||||
for person in people:
|
for person in people:
|
||||||
if person["name"] == name:
|
if person["name"] == name:
|
||||||
return person["email"]
|
return person["email"]
|
||||||
else:
|
return None
|
||||||
return None
|
|
||||||
|
|
||||||
def count_favorite_colors(people, name):
|
def count_favorite_colors(people, name):
|
||||||
"""Returns the number of colors liked by the named person. If there is no such person, returns None.
|
"""Returns the number of colors liked by the named person. If there is no such person, returns None.
|
||||||
@@ -45,8 +44,7 @@ def count_favorite_colors(people, name):
|
|||||||
if person["name"]== name:
|
if person["name"]== name:
|
||||||
colors = person["favorite_colors"]
|
colors = person["favorite_colors"]
|
||||||
return len(colors)
|
return len(colors)
|
||||||
else:
|
return None
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user