From 8c678d274a5607168133140ef17c29cc6285d9d3 Mon Sep 17 00:00:00 2001 From: Chris Mekelburg Date: Sun, 20 Oct 2024 20:18:55 -0400 Subject: [PATCH] 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. --- friend_functions.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/friend_functions.py b/friend_functions.py index 6e50d24..3bc6268 100644 --- a/friend_functions.py +++ b/friend_functions.py @@ -30,8 +30,7 @@ def get_email(people, name): for person in people: if person["name"] == name: return person["email"] - else: - return None + 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. @@ -45,8 +44,7 @@ def count_favorite_colors(people, name): if person["name"]== name: colors = person["favorite_colors"] return len(colors) - else: - return None + return None