-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchapter_03.py
More file actions
61 lines (44 loc) · 1.15 KB
/
chapter_03.py
File metadata and controls
61 lines (44 loc) · 1.15 KB
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
56
57
58
59
60
61
age = 17
# ============ > if statement < ==============
# if age >= 18:
# print("you are eligible for the vote.")
# ============ > if-else statement < ==============
# if age >= 18 :
# print("you are eligible for the vote.")
# else :
# print("you are not eligible for the vote.")
# =========== > if_elif_else statement <===================
# math_marks = 61
# if math_marks >= 90:
# print("Grade : A")
# elif math_marks >= 80:
# print("Grade : B")
# elif math_marks >= 70:
# print("Grade : C")
# elif math_marks >= 60:
# print("Grade : D")
# else :
# print("Grade : F")
# ======== > Nested COndition < ==========
# age = 18
# citizen = "Pakistan"
# if age >= 18:
# if citizen == "Pakistan":
# print("You can vote.")
# else :
# print("only citizens can vote.")
# else:
# print("you must be 18 or older to vote.")
# ============ > Match Case Statement < =============
# a = 10
# b = 20
# c = a + b
# match c:
# case 10:
# print("answer is 10")
# case 20:
# print("answer is 20")
# case 30:
# print("answer is 30")
# case _:
# print("answer not match")