Mousei007 commited on
Commit
e34ae0f
·
verified ·
1 Parent(s): b6e38bf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -49,14 +49,14 @@ def get_weather(city: str) -> str:
49
  "units": "metric"
50
  }
51
 
52
- response = requests.get(url, params=params)
53
 
54
- data = response.json()
55
 
56
- weather = data["weather"][0]["description"]
57
- temp = data["main"]["temp"]
58
 
59
- return f"The weather in{city} is {weather}, temperature {temp}°C"
60
  except Exception as e:
61
  return f"Error fetching weather: {str(e)}"
62
 
 
49
  "units": "metric"
50
  }
51
 
52
+ response = requests.get(url, params=params)
53
 
54
+ data = response.json()
55
 
56
+ weather = data["weather"][0]["description"]
57
+ temp = data["main"]["temp"]
58
 
59
+ return f"The weather in{city} is {weather}, temperature {temp}°C"
60
  except Exception as e:
61
  return f"Error fetching weather: {str(e)}"
62