list=[]dict ={}
date=['2021-08-11'2021-09-212021-08-28]
temp =['18','29','31']
for i in range(3):
dict['date’]= date[i]dict['weather']= temp[i]list.append(dict)
执行上面代码后,list的值为
[{'date': '2021-08-11', 'weather': '18'}, {'date’: '2021-09-21', 'weather': '29'}, {'date': '2021-08-28','weather': '31'}