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 官宣新年祝福语简短