Spaces:
Sleeping
Sleeping
Update app.py
Browse filesFixed syntax error [replaced ," °C" with + " °C"
app.py
CHANGED
|
@@ -39,7 +39,7 @@ def get_weather(location:str)-> str: #it's import to specify the return type
|
|
| 39 |
# Extract weather data
|
| 40 |
weather_data= current_conditions["weatherDesc"][0]["value"]
|
| 41 |
# Extract temperature data
|
| 42 |
-
temperature_data= current_conditions["temp_C"]
|
| 43 |
return f"For {location} location, Weather: {weather_data} Temperature: {temperature_data}"
|
| 44 |
except Exception as e:
|
| 45 |
return f"Error fetching weather data for location '{location}': {str(e)}"
|
|
|
|
| 39 |
# Extract weather data
|
| 40 |
weather_data= current_conditions["weatherDesc"][0]["value"]
|
| 41 |
# Extract temperature data
|
| 42 |
+
temperature_data= current_conditions["temp_C"]+ " °C"
|
| 43 |
return f"For {location} location, Weather: {weather_data} Temperature: {temperature_data}"
|
| 44 |
except Exception as e:
|
| 45 |
return f"Error fetching weather data for location '{location}': {str(e)}"
|