Created
September 11, 2019 16:14
-
-
Save DuncantheeDuncan/5d9de4b3d4109b48cc57124a476c7f0b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# days of the week represented in numbers | |
# this program takes an inputs from the user | |
# and a number is assagned with a day in the week | |
daysOfTheWeek = input("enter a number between a 1 and 7: ") | |
if (daysOfTheWeek == 1): | |
print "Monday" | |
elif(daysOfTheWeek == 2): | |
print "Tuesday" | |
elif(daysOfTheWeek == 3): | |
print "Wednesday" | |
elif(daysOfTheWeek == 4): | |
print "Thursday" | |
elif(daysOfTheWeek == 5): | |
print "Friday" | |
elif(daysOfTheWeek == 6): | |
print "Saturday" | |
elif(daysOfTheWeek == 7): | |
print "Sunday" | |
else: | |
(daysOfTheWeek >7 | daysOfTheWeek <1) | |
print "error ",daysOfTheWeek," is not within the range of 1 and 7\n", | |
"Please enter a number between 1 and 7" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment