Find Any Year’s or Month’s Calendar Using Python Calendar Module

Jayeeta Mondal
2 min readNov 15, 2021

--

Easily access any year’s or month’s calendar anytime online using python & schedule your day accordingly!

Photo by Mockaroon on Unsplash

Python’s calendar module provides access to the calendar of any month of any year or the whole year anytime you want to show to the user. For that you need to import the calendar module. The built-in function month() inside the module takes in the year and the month and displays the calendar for that month of the year & calendar() function displays the year which the user want to display.

Code

First you need to import the calendar module. After that declare the year and month variable respectively & pass the input taken from the user as year and month through it. Now call month() function & pass month & year through it to print the month of that respective year. To display a particular year you need to call calendar() function from the calendar module & pass the year through it.

Output

Summary

So you can display calendar any time with the help of these few lines of code & it’s very easy. This project is mainly for begginners. However you can integrate it with any big project & make a best use of it. I hope you find this article useful. If you have any question feel free to ask in the comment section below.

--

--

Jayeeta Mondal
Jayeeta Mondal

Written by Jayeeta Mondal

Data Scientist || Freelancer || Open Source Contributor

No responses yet