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.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
#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 |