A
A
Ananas193z2021-06-29 18:00:09
Python
Ananas193z, 2021-06-29 18:00:09

How can I get only the temperature out of there?

i have
reg = owm.city_id_registry()
loc = reg.locations_for('Moscow', country='RU')
one_call = mgr.one_call(loc[0].lat, loc[0].lon)
forecast = one_call.forecast_daily
# get a list of forecasts for each subsequent day
print(forecast[0].temperature('celsius'))

How can I get only the temperature from there using the (print) command?(For tomorrow)
From:
{'day': 18.56, 'min': 15.27, 'max': 19.73, 'night': 15.27, 'eve': 18.82, 'morn': 18.19, 'feels_like_day': 18.61, 'feels_like_night': 14.94, 'feels_like_eve': 18.56, 'feels_like_morn': 18.49}
Help me please

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ruslan., 2021-06-29
@LaRN

I think it will help
print(forecast[0].temperature('celsius')['day'])

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question