Python calendar Module Methods

Python calendar Module has the following built-in functions.

Method Description
calendar() Returns a 3-column calendar for an entire year.
firstweekday() Returns the current setting for the weekday to start each week.
isleap() Returns true if the year is leap else returns false.
leapdays() Returns the number of leap days between the two given years in the function argument.
month() Returns a multi-line string representation of the given month's calendar.
monthcalendar() Returns a matrix representing the given month's calendar.
monthrange() Returns a tuple where the first value is the weekday of first day of the month and the second value is the number of days in month, for the specified year and month.
prcal() Prints the calendar of the specific year. Also, there is no need for "print" operation to execute this.
prmonth() Prints the calendar of the given month of the given year. Also, there is no need of "print" operation to execute this.
setfirstweekday() Sets the first weekday from when the week should start. Here, Monday is 0, incrementing by 1 till Sunday, which is 6.
weekday() Returns what is the day of the week for the given year, month and day mentioned in the function argument.
weekheader() Returns a header containing the abbreviated names of the weekday.





Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.





Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates


© https://www.includehelp.com some rights reserved.