@Ananas193z

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
# получаем список из прогнозов на каждый последующий день
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
  • Вопрос задан
  • 75 просмотров
Пригласить эксперта
Ответы на вопрос 1
LaRN
@LaRN
Senior Developer
I think it will helps
print(forecast[0].temperature('celsius')['day'])
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы