-
Notifications
You must be signed in to change notification settings - Fork 19
/
month.py
32 lines (25 loc) · 849 Bytes
/
month.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
# Name:
# Date:
# A program that uses functions to print out months.
def monthString(monthNum):
"""
Takes as input a number, monthNum, and
returns the corresponding month name as a string.
Example: monthString(1) returns "January".
Assumes that input is an integer ranging from 1 to 12
"""
monthString = ""
###################################
### FILL IN YOUR CODE HERE ###
### Other than your name above, ###
### this is the only section ###
### you change in this program. ###
###################################
return(monthString)
def main():
n = int(input('Enter the number of the month: '))
mString = monthString(n)
print('The month is', mString)
#Allow script to be run directly:
if __name__ == "__main__":
main()