- 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))
Enter year
2019
Enter Month
4
April | ||||||
---|---|---|---|---|---|---|
Mon | Tue | Wed | Thu | Fri | Sat | Sun |
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 |
Enter year
2019
Enter Month
8
August | ||||||
---|---|---|---|---|---|---|
Mon | Tue | Wed | Thu | Fri | Sat | Sun |
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 |