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




plus2net.com



Post your comments , suggestion , error , requirements etc here




We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
©2000-2020 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer