Skip to content

Commit

Permalink
feat: porting di ex1 da cpp, implementazione dello switch case
Browse files Browse the repository at this point in the history
  • Loading branch information
Darakuu committed Oct 30, 2023
1 parent c446327 commit 0908c3e
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/ex1.py
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()

0 comments on commit 0908c3e

Please sign in to comment.