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

Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Best Website and Software Company in Allahabad