-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathmatch2.py
More file actions
55 lines (37 loc) · 931 Bytes
/
match2.py
File metadata and controls
55 lines (37 loc) · 931 Bytes
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
def monday():
print("Monday")
def tuesday():
print("Tuesday")
def wednesday():
print("Wednesday")
def thursday():
print("Thursday")
def friday():
print("Friday")
def saturday():
print("Saturday")
def sunday():
print("Sunday")
def otherDay():
print("other day??")
def doit(month):
for day in [1, 2, 3, 4, 5, 6, 7, otherDay]:
match day:
case 1 if 1 <= month <= 12:
monday()
case 2 if 1 <= month <= 12:
tuesday()
case 3 if 1 <= month <= 12:
wednesday()
case 4 if 1 <= month <= 12:
thursday()
case 5 if 1 <= month <= 12:
friday()
case 6 if 1 <= month <= 12:
saturday()
case 7 if 1 <= month <= 12:
sunday()
case x if callable(x):
x()
doit(4)
doit(0)