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, 星期日'))
制作打卡表-列出周六周日-Python
最新推荐文章于 2024-07-24 23:23:37 发布