python-杂碎知识4-calendar

日历:

import calendar
#打印年历
print(calendar.calendar(1990))
#打印月历
print(calendar.month(1990, 11))
#打印周几
print(calendar.weekday(1990,11,20))
'''
返回日期是周几
周一  0
周二  1
....
周日  6
'''
import datetime
print(datetime.datetime(1990, 11, 20).weekday())

 每篇一句:

  不动声色

posted on 2021-11-26 23:27  Titen  阅读(31)  评论(0编辑  收藏  举报

导航