iterweekdays() 在 python 中的含義是什麼?
iterweekdays() 方法。iterweekdays() 方法返回一個一週的星期幾數字的迭代器。
示例
#Write a python program to print iterweekdays() using list import calendar # prints firstweekday starts with 4 th day day= calendar.Calendar(firstweekday = 4) list(day.iterweekdays())
輸出
[4, 5, 6, 0, 1, 2, 3]
或
import calendar #prints firstweekday starts with 0 th day variable= calendar.Calendar(firstweekday = 0) for day in variable.iterweekdays(): print(day)
輸出
0 1 2 3 4 5 6
廣告
資料結構
網路
RDBMS
作業系統
Java
iOS
HTML
CSS
Android
Python
C 程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP