Questions

How do you Make a Calendar in Python?

In Python, we can display the calendar by importing the calendar module to our program. The calendar in python module’s built-in function month() takes the year and the month as input and shows the calendar for the input entered by the user. 

                    

Source Code

import calendar

#initialize the year and the month variables

yr = 2020

mnth = 1

# printing the calendar

print(calendar.month(yr, mnth))

Output:

January 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 30 31

Related Questions

Related Topics

Share with friends

Customize your course in 30 seconds

Which class are you in?
5th
6th
7th
8th
9th
10th
11th
12th
Get ready for all-new Live Classes!
Now learn Live with India's best teachers. Join courses with the best schedule and enjoy fun and interactive classes.
tutor
tutor
Ashhar Firdausi
IIT Roorkee
Biology
tutor
tutor
Dr. Nazma Shaik
VTU
Chemistry
tutor
tutor
Gaurav Tiwari
APJAKTU
Physics
Get Started

Leave a Reply

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

Download the App

Watch lectures, practise questions and take tests on the go.

Customize your course in 30 seconds

No thanks.