for y in [2020, 2021]:
for m in range(1,13):
for day in range(1, 32):
try:
d = datetime.date(y,m,day)
except:
pass
if d.weekday() == 5:
print(d.strftime('%Y-%m-%d, 星期六'))
elif d.weekday() == 6:
print(d.strftime('%Y-%m-%d, 星期日'))
相关文章
- 11-25制作打卡表-列出周六周日-Python