Python program to display calendar

Created with Sketch.

Python program to display calendar

It is simple in python programming to display calendar. To do so, you need to import the calendar module which comes with Python.

  1. import calendar
  2.  And then apply the syntax
  3. (calendar.month(yy,mm))

See this example:

  1. import calendar
  2. # Enter the month and year
  3. yy = int(input(“Enter year: “))
  4. mm = int(input(“Enter month: “))
  5. # display the calendar
  6. print(calendar.month(yy,mm))

Output:

Python Basic Programs10

 

Leave a Reply

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