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/ Explanation:

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

Latest Current Affairs 2026 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad