ninooo96 commited on
Commit
7c080bb
·
verified ·
1 Parent(s): 4493cff

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -54,8 +54,9 @@ def get_weather(city: str) -> str:
54
  weather_response = requests.get(weather_url)
55
  if weather_response.status_code == 200:
56
  weather_data = weather_response.json()
 
57
  temperature = weather_data['current_weather']['temperature']
58
- return f"The current weather on {city} is {temperature}"
59
  else:
60
  return "Error on fetching weather data."
61
  else:
 
54
  weather_response = requests.get(weather_url)
55
  if weather_response.status_code == 200:
56
  weather_data = weather_response.json()
57
+ unit = weather_data['current_weather_units']['temperature']
58
  temperature = weather_data['current_weather']['temperature']
59
+ return f"{temperature}{unit}"
60
  else:
61
  return "Error on fetching weather data."
62
  else: