Question: How can I convert month 6 to June? Is it possible?
JavaScript
x
10
10
1
input:
2
import calendar
3
y= int(input('Input the year: '))
4
m=int(input('Input the month: '))
5
print("Here's the calendar {},{}".format(m,y))
6
output:
7
Input the year: 2021
8
Input the month: 6
9
Here's the calendar 6,2021
10
Advertisement
Answer
This would work:
JavaScript
1
19
19
1
import calendar
2
y= int(input('Input the year: '))
3
m=int(input('Input the month: '))
4
months = {
5
1: 'January',
6
2: 'February',
7
3: 'March',
8
4: 'April',
9
5: 'May',
10
6: 'June',
11
7: 'July',
12
8: 'August',
13
9: 'September',
14
10: 'October',
15
11: 'November',
16
12: 'December'
17
}
18
print("Here's the calendar {},{}".format(months[m],y))
19