-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path23.py
More file actions
36 lines (29 loc) · 744 Bytes
/
23.py
File metadata and controls
36 lines (29 loc) · 744 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
#Exmple 1
age=int(input('enter a age :'))
match age:
case _ if age<5:
print("bus pass is free")
case _ if age>=60:
print("they get a senior citizen discount")
case _:
print("they pay the full fees")
#Example 2
time=int(input('enter a time :'))
match time:
case 8:
print("Breakfast")
case 13:
print("Lunch")
case 20:
print("Dinner")
case _:
print("It's not a meal time.")
#Example 3
age=int(input("enter a age :"))
match age:
case _ if age<18:
print("tehy get student membership")
case _ if age>=60:
print("they get a senior citizen")
case _:
print("they get a regular membership")