Guest User

Untitled

a guest
Jun 19th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. def getForecast():
  2.  
  3. zip2 = '60103'
  4.  
  5. url = 'http://api.openweathermap.org/data/2.5/forecast?zip='
  6. '' + zip2 +
  7. ',us&appid=7f5941b864a5fde449419c6aaca23540&units=imperial'.format(zip2)
  8.  
  9. response = requests.get(url)
  10. data2 = response.json()
  11.  
  12. date_list = (data2['list'][0]['dt_txt'])
  13. date_list = date_list.split()
  14. del date_list[-1]
  15. new = list(date_list[0].split('-'))
  16. new1 = [int(x) for x in new]
  17.  
  18.  
  19. print(calendar.weekday(new1))
Add Comment
Please, Sign In to add comment