Vaqash commited on
Commit
b5c715e
·
verified ·
1 Parent(s): 8d02cf2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -28,8 +28,7 @@ def get_weather(city: str, country_code: str = "US") -> str:
28
  data = response.json()
29
 
30
  if response.status_code != 200:
31
- return f"Failed to fetch weather: {data
32
- .get('message', 'Unknown error')}"
33
 
34
  weather_description = data["weather"][0]["description"]
35
  temperature = data["main"]["temp"]
 
28
  data = response.json()
29
 
30
  if response.status_code != 200:
31
+ return f"Failed to fetch weather: {data.get('message', 'Unknown error')}"
 
32
 
33
  weather_description = data["weather"][0]["description"]
34
  temperature = data["main"]["temp"]