Python Program to Display Calendar of any Month and Year

In this tutorial you will learn to write a simple Python Program to Display Calendar of any Month and Year

Python Example Program Source Code

1 # Import the calendar module  
2 import calendar  
3 
4 # User input for month and year  
5 year = int(input("Enter year: "))  
6 month = int(input("Enter month: "))  
7 
8 # Display the calendar  
9 print(calendar.month(year,month))

Program Output : Run 1

Enter year: 1990

Enter month: 2

February 1990

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