show the month of the given year in python by R4R Team

- month() is a python function which define in calendar module.
-return the string which are in date and days format.

Syntax-

calendar.month(year,month)


program-

#import calendar module
import calendar

#take input of year and month
print("Enter year")
y=int(input())
print("Enter Month")
m=int(input())

#display month of given year
print(calendar.month(y,m))


output-

Enter year
2019
Enter Month
4

April
MonTueWedThuFriSatSun
1234567
891011121314
15161718192021
22232425262728
2930Â Â Â Â Â

Enter year
2019
Enter Month
8

August
MonTueWedThuFriSatSun
   1234
567891011
12131415161718
19202122232425
262728293031Â


-In this program, we take an input of the year and the month, then using calendar.month() function we display the required whole month with date and days.




Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!