Skip to content

Commit 4a60568

Browse files
committed
added comments
1 parent 07dab2d commit 4a60568

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

lesson23/server.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ def get_weather():
1717

1818
# Check for empty strings or string with only spaces
1919
if not bool(city.strip()):
20+
# You could render "City Not Found" instead like we do below
2021
city = "Kansas City"
2122

2223
weather_data = get_current_weather(city)

lesson23/weather.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ def get_current_weather(city="Kansas City"):
2121
city = input("\nPlease enter a city name: ")
2222

2323
# Check for empty strings or string with only spaces
24-
if not bool(city.strip()):
25-
city = "Kansas City"
24+
# This step is not required here
25+
# if not bool(city.strip()):
26+
# city = "Kansas City"
2627

2728
weather_data = get_current_weather(city)
2829

0 commit comments

Comments
 (0)