解釋 python 中的日曆模組?


Python 有一個內建模組,會匯入模組中的所有類和函式。

示例

#Write a python program to print month of a calendar?
import calendar
#prints may month calendar
print(calendar.month(2019,5))

產出

May 2019
Mo Tu We Th Fr Sa Su
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31

更新於: 30-7-2019

295 檢視

開啟你的職業生涯

完成課程即可獲得認證

立即開始
廣告