我是靠谱客的博主 勤恳铃铛,这篇文章主要介绍python中日历模块,现在分享给大家,希望可以做个参考。

“日历模块”
import calendar

“打印年历”
#calendar.calendar(年)
print(calendar.calendar(2022))

“打印月历”
#calendar.month(年, 月)
print(calendar.month(2022, 1))

“是否为闰年”
#calendar.isleap(年)
print(calendar.isleap(2022))

“”"
返回日期是周几
周一 0
周二 1

周末 6
“”"
#calendar.weekday(年, 月 日)
print(calendar.weekday(2022, 2, 17))

最后

以上就是勤恳铃铛最近收集整理的关于python中日历模块的全部内容,更多相关python中日历模块内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(144)

评论列表共有 0 条评论

立即
投稿
返回
顶部