-
Notifications
You must be signed in to change notification settings - Fork 324
/
Copy pathdays.py
35 lines (25 loc) · 869 Bytes
/
days.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
#CSci 127 Teaching Staff
#A program that uses functions to print out days.
#Modified by: --YOUR NAME HERE-- , --YOUR EMAIL HERE--
def dayString(dayNum):
"""
Takes as input a number, dayNum, and
returns the corresponding day name as a string.
Example: dayString(1) returns "Monday".
Assumes that input is an integer ranging from 1 to 7
"""
dayString = ""
###################################
### FILL IN YOUR CODE HERE ###
### Other than your name above, ###
### this is the only section ###
### you change in this program. ###
###################################
return(dayString)
def main():
n = int(input('Enter the number of the day: '))
dString = dayString(n)
print('The day is', dString)
#Allow script to be run directly:
if __name__ == "__main__":
main()