{"id":26013,"date":"2021-12-07T18:06:53","date_gmt":"2021-12-07T12:36:53","guid":{"rendered":"https:\/\/python-programs.com\/?p=26013"},"modified":"2021-12-08T20:41:38","modified_gmt":"2021-12-08T15:11:38","slug":"python-program-for-calendar-pryear-method-with-examples","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-for-calendar-pryear-method-with-examples\/","title":{"rendered":"Python Program for calendar pryear() Method with Examples"},"content":{"rendered":"

Calendar Module:<\/strong><\/p>\n

The calendar module allows you to output calendars like a program and includes extra calendar-related operations. Calendar module functions and classes make use of an idealized calendar, the current Gregorian calendar extended in both directions indefinitely.<\/p>\n

pryear() Method:<\/strong><\/p>\n

The pryear() method prints the calendar for the complete year as returned by formatyear().<\/p>\n

To generate plain text calendars, class calendar.TextCalendar(firstweekday=0) can be used.The pryear() method is one of the TextCalendar instance’s methods.<\/p>\n

Syntax:<\/strong><\/p>\n

pryear(year, width=2, lines=1, c=6, m=3)<\/pre>\n

Parameter Values:<\/strong><\/p>\n

year:<\/strong> This is required. It is a number. It is the year for which the calendar should be created.<\/p>\n

width:<\/strong> This is Optional. It is a number. The distance between two columns. 2<\/strong> is the default value.<\/p>\n

lines:<\/strong> This is Optional. It is a number. A blank line between two rows. 1<\/strong> is the default value.<\/p>\n

c:<\/strong> This is Optional. It is a number. It is the space between two months (column-wise). 6<\/strong> is the default value.<\/p>\n

m:<\/strong> This is Optional. It is a number. It is the number of months in a row. 3<\/strong> is the default value.<\/p>\n

Return Value:<\/strong> A m-column calendar for the whole year is returned.<\/p>\n

Program for calendar pryear() Method with Examples in Python<\/h2>\n