Python Program to Display Calendar – 2022

Machine Learning Projects

Hey guys, in this blog we will see a Python Program to Display Calendar.

Code

# Python Program to Display Calendar of the given month and year

# importing calendar module
import calendar

yy = int(input("Enter year: "))
mm = int(input("Enter month: "))

# display the calendar
print()
print(calendar.month(yy, mm))

Output

Enter year: 2022
Enter month: 10

    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
  • We have used the Calendar package of python to print the calendar of a specific month of a specific year.
  • We are taking Month and Year as input from the user.

Check out our other python programming examples

Leave a Comment

Your email address will not be published. Required fields are marked *