DEV Community

Cover image for How to Print Calendar of Any Year in Python
Ankit Kumar
Ankit Kumar

Posted on • Updated on

How to Print Calendar of Any Year in Python



import calendar 
#This Will import the calendar module
year = int(input("Enter any year: ")) 
#Here we are asking user to input year and we are storing 
#it into year variable.
print(calendar.calendar(year))
#Here we are using calendar method of calendar module and passing 
#year as arguments and this will return us calendar of the year 
#and then with the help of print function we are printing the
#returned data."""

Enter fullscreen mode Exit fullscreen mode

Top comments (0)