Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- from datetime import datetime, date, time
- city = input()
- r = requests.get('http://api.openweathermap.org/data/2.5/forecast?&units=metric&q=%s&appid=295f286d77a869327ed8dfae72a0542d' % (city))
- data = r.json()
- temp = data["list"]
- for id in temp:
- tmp = id["main"]["temp"]
- tmp = str(round(tmp))
- dt = id["dt_txt"]
- print(dt + " - " + tmp + "°C")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement