Answer the question
In order to leave comments, you need to log in
How to properly distribute information?
The code:
import requests
x = input("Введите название города: ")
appid = "APPid"
res = requests.get("http://api.openweathermap.org/data/2.5/forecast", params={
'q': x, 'units': 'metric', 'lang': 'ru', 'APPID': appid})
data = res.json()
for i in data['list']:
a = f"{i['dt_txt'][5:10]}: \n"
b = f"{i['dt_txt'][11:16]}: Температура: {'{0:+3.0f}'.format(i['main']['temp'])}, ветер: {'{0:1.0f}'.format(i['wind']['speed'])} м/с, описание: {i['weather'][0]['description']}"
print(a+b)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question