-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: porting di ex1 da cpp, implementazione dello switch case
- Loading branch information
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Improve this program using a switch-case. | ||
def day_of_the_week(): | ||
weekDay = 0 | ||
# Input week number from user | ||
weekDay = int(input("Enter week number(1-7): ")) | ||
match weekDay: | ||
case 1: | ||
print("Monday") | ||
case 2: | ||
print("Tuesday") | ||
case 3: | ||
print("Wednesday") | ||
case 4: | ||
print("Thursday") | ||
case 5: | ||
print("Friday") | ||
case 6: | ||
print("Saturday") | ||
case 7: | ||
print("Sunday") | ||
case _: | ||
print("Invalid input! Please enter week number between 1-7.") | ||
|
||
|
||
day_of_the_week() |