python中的iterweekdays()是什么?
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
热门推荐
10 广西考试祝福语结婚简短
11 猪年祝福语简短小孩
12 元旦祝福语送长辈简短
13 恭喜二宝祝福语简短
14 祝福语暖心话简短
15 国庆中秋祝福语简短兄弟
16 朋友订婚的祝福语简短
17 送弟弟中秋祝福语简短
18 爱生日祝福语简短独特