Python Program to Display Calendar of Given YearIn this tutorial, we will learn how to display the calendar of any month of any year using Python. In the code below, we will import the "calendar" module. It has an inbuilt "month()" function, which takes the year and month of which the user wants to display the calendar. Example: <Output: Case -1 Please enter the Year: 1919 Please enter the month: 01 The Calendar of: January 1919 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 31 Case -2 Please enter the Year: 2022 Please enter the month: 10 The Calendar of: October 2022 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 31 ConclusionIn this tutorial, we have discussed how a user can display the calendar in Python.
Next TopicHow to open URL in Python
|
JavaTpoint offers too many high quality services. Mail us on h[email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected].
Duration: 1 week to 2 week