Python calendar module | firstweekday() method
Calendar module allows to output calendars like program, and provides additional useful functions related to the calendar. Functions and classes defined in Calendar module use an idealized calendar, the current Gregorian calendar extended indefinitely in both directions.
calendar.firstweekday() is a function provided in calendar module for simple text calendars.
firstweekday() method is used to get the current setting for the weekday to start each week.
Syntax: firstweekday() Parameter: no parameter Returns: None
Default First weekday is - 6 First weekday after modification is - 2
Code #2: Explaining working of firstweekday() method with prmonth() method
The 4th month of 1997 is : April 1997 Mo Tu We Th Fr Sa Su 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 First weekday after modification is - 4
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course