iterweekdays()
« Calendar Module
iterweekdays() : Returns an Iterator having week day in numbers.
Starting number is 0 ( default number for Monday ) but can be changed based on setting of setfirstweekday()
import calendar
my_cal= calendar.Calendar()
for x in my_cal.iterweekdays():
print(x)
Output
0
1
2
3
4
5
6
We can set first week day to Friday ( firstweekday=4)
import calendar
my_cal= calendar.Calendar(firstweekday=4)
for x in my_cal.iterweekdays():
print(x)
Output
4
5
6
0
1
2
3
«Calendar Module in Python
← Subscribe to our YouTube Channel here
This article is written by plus2net.com team.
https://www.plus2net.com
plus2net.com