caput commited on
Commit
d086d2c
·
verified ·
1 Parent(s): 73ec286

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -40,9 +40,9 @@ def get_temperature(location: str) -> str:
40
  location: The name of the city or place (e.g., 'New York').
41
  """
42
  try:
43
- response = requests.get(f'https://wttr.in/{location}?format=%t')
44
  if response.status_code == 200:
45
- return f"The current temperature in {location} is {response.text}"
46
  else:
47
  return "Failed to retrieve temperature. Please check the location name."
48
  except Exception as e:
 
40
  location: The name of the city or place (e.g., 'New York').
41
  """
42
  try:
43
+ response = requests.get(f'https://wttr.in/{location}?format=%t&u')
44
  if response.status_code == 200:
45
+ return f"The current temperature in {location} is {response.text} °C"
46
  else:
47
  return "Failed to retrieve temperature. Please check the location name."
48
  except Exception as e: