Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,9 +16,8 @@ def get_weather(city:str)-> str: #it's import to specify the return type
|
|
| 16 |
city: Name of the city
|
| 17 |
"""
|
| 18 |
try:
|
| 19 |
-
search =
|
| 20 |
-
|
| 21 |
-
return f"Weather in {city} is {result}"
|
| 22 |
except Exception as e:
|
| 23 |
return f"Error fetching weather for {city}: {str(e)}"
|
| 24 |
|
|
|
|
| 16 |
city: Name of the city
|
| 17 |
"""
|
| 18 |
try:
|
| 19 |
+
search = requests.get(f"https://wttr.in/{city}?format=3")
|
| 20 |
+
return f"Weather in {city}: {search.text}"
|
|
|
|
| 21 |
except Exception as e:
|
| 22 |
return f"Error fetching weather for {city}: {str(e)}"
|
| 23 |
|