;

Python Program to Display the Calendar of the Month


Tutorialsrack 23/04/2020 Python

In the Python program, we will learn how to display the calendar of the given month. And for displaying the calendar of the month, we used the built-in function month() from the calendar module which takes the two parameters: First parameter as year and second parameter as month number.

 Here is the code of the program to display the calendar of the given month.

Python Program to Display the Calendar of the Month
# Python Program to Display the Calendar of the Month

# Import module
import calendar

# To take month and year input from the user
year = int(input("Enter the year: "))
month = int(input("Enter the month: "))

# display the calendar
print("\n",calendar.month(year, month))
Output

Enter the year: 2020

Enter the month: 02

 

    February 2020

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


Related Posts



Comments

Recent Posts
Tags