-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmonthfunction.py
47 lines (39 loc) · 1.04 KB
/
monthfunction.py
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#Mohib Ahmed
#June 23 2023
#fill out monthstring function
def monthString(monthNum):
monthString = ""
if monthNum == 1:
monthString = "January"
elif monthNum == 2:
monthString = "February"
elif monthNum == 3:
monthString = "March"
elif monthNum == 4:
monthString = "April"
elif monthNum == 5:
monthString = "May"
elif monthNum == 6:
monthString = "June"
elif monthNum == 7:
monthString = "July"
elif monthNum == 8:
monthString = "August"
elif monthNum == 9:
monthString = "September"
elif monthNum == 10:
monthString = "October"
elif monthNum == 11:
monthString = "November"
elif monthNum == 12:
monthString = "December"
else:
monthString = "Invalid month number"
return monthString
def main():
n = int(input('Enter the number of the month: '))
mString = monthString(n)
print('The month is', mString)
if __name__ == "__main__":
main()