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