Python | Calendar Module Python defines an inbuilt module calendar that handles operations related to the calendar. The calendar module allows output calendars like the program and provides additional useful functions related to the calendar. Functions and classes defined in the Calendar module use an idealized calendar, the current Gregorian calendar extended indefinitely in both directions. By default, these calendars have Monday as the first day of the week, and Sunday as the last (the European convention). Example #1: Display the Calendar of a given month. # Python program to display calendar of # given month of the year # import module import calendar yy = 2017 mm = 11 # display the calendar print(calendar.month(yy, mm)) Output: Example #2: Display calendar of the given year. # Python code to demonstrate the working of # calendar() function to print calendar # importing calendar module # for calendar operations import cale...
Comments
Post a Comment