0星期一 - 蓝桥云课 (lanqiao.cn)
import datetimestart = datetime.date(1901, 1, 1) end = datetime.date(2000, 12, 31)res = 0 while not start > end:if start.weekday() == 0:res += 1start += datetime.timedelta(days=1) print(res)
datetime 模块
import datetime
now=datetime.date.today() #2024-02-05