'''
本功能获取时间范围内每个月的最后一天并格式化成'yyyymmdd'字符串
'''
import calendar
daliy = []
for years in range(2019,2023):
for month in range(1,13):
cal = calendar.month(years,month)
# print(cal)
day = int(cal[-3:])
daliy.append((years,month,day))
print(daliy)
for i in daliy:
y = str(i[0])
if i[1] < 10:
m = str('0'+str(i[1]))
else:
m = str(i[1])
if i[2] < 10:
d = str('0'+str(i[2]))
else:
d = str(i[2])
date = y+m+d
print(date)