Programming Examples

Python program to print the calendar of given month and year


calendar

Write a python program which accept the year and month from user and print the calendar for that month and year

import calendar
year = int(input("Enter Year 'YYYY' : "))
month = int(input("Enter Month 'MM' : "))
print(calendar.month(year, month))
Output

Enter Year 'YYYY' : 2021

Enter Month 'MM' : 08

    August 2021

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

CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad