i
根据日历文档,“ new1”应采用正确的格式以返回星期几,但我收到错误消息:“ def getForecast():
zip2 = '60103'
url = 'http://api.openweathermap.org/data/2.5/forecast?zip=' \
'' + zip2 +
',us&appid=7f5941b864a5fde449419c6aaca23540&units=imperial'.format(zip2)
response = requests.get(url)
data2 = response.json()
date_list = (data2['list'][0]['dt_txt'])
date_list = date_list.split()
del date_list[-1]
new = list(date_list[0].split('-'))
new1 = [int(x) for x in new]
print(calendar.weekday(new1))
”,当我手动插入年,月,日,我一周中的哪一天都很好。