from datetime import * s = date(2000,1,1) t = date(2020,10,1) ans = 0 while s <= t: if s.day ==1 or s.weekday ==0: ans +=2 else: ans +=1 s += timedelta(1) print(ans)
蓝桥杯——跑步锻炼
最新推荐文章于 2024-08-16 16:00:00 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)
from datetime import * s = date(2000,1,1) t = date(2020,10,1) ans = 0 while s <= t: if s.day ==1 or s.weekday ==0: ans +=2 else: ans +=1 s += timedelta(1) print(ans)