-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmatch_case.py
More file actions
21 lines (20 loc) · 766 Bytes
/
match_case.py
File metadata and controls
21 lines (20 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Get input from the user
day = input("Enter a day of the week (e.g., Monday, Tuesday): ")
# Use match-case to print a message based on the day
match day:
case "Monday":
print("It's the start of the work week!")
case "Tuesday":
print("It's Tuesday, keep going!")
case "Wednesday":
print("It's the middle of the week, halfway there!")
case "Thursday":
print("It's Thursday, almost the weekend!")
case "Friday":
print("It's Friday, the weekend is near!")
case "Saturday":
print("It's Saturday, enjoy your weekend!")
case "Sunday":
print("It's Sunday, time to relax before the week starts again!")
case _:
print("That's not a valid day of the week.")