零基础学python日历calendar

2025-07-09 17:13:23

1、首先导入calendar模块。

零基础学python日历calendar

3、# 年历(本质是字符串)b = calendar.calendar(2018)print(b, type(b))结果如图:

零基础学python日历calendar

5、# 以周为单位的列表d = calendar.monthcalendar(2018, 2)print(d)结果如图:

零基础学python日历calendar

7、 完整代码如下:

零基础学python日历calendar
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢