Display calendar

To display calendar of a year here,we are using a calendar function and to display a particular month of a year ,we are using a month function from calendar module of python.

#import the calender module

import calendar

print("To display a calender of given month")
yy=int(input("Enter  a year"))
mm=int(input("Enter  a month to be display"))
print(calendar.month(yy,mm))   #Month module display the calender of given month of given year


print("To display a calender of given year")
yy1=int(input("Enter  a year"))
print(calendar.calendar(yy1))  # Display module display the calender of given year

 

Leave a Comment

%d bloggers like this:
Python4U
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.