-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsample.py
More file actions
52 lines (43 loc) · 699 Bytes
/
sample.py
File metadata and controls
52 lines (43 loc) · 699 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
name = "Kj"
age = 17
# True False
if not name == "Kj" or not age == 15:
print("Hello Kj")
else:
print("Hello Stranger")
'''
Truth Table
AND Both conditions are true
X Y Z
T T T
F T F
T F F
F F F
XAND Both conditions are false
if not condition1 and condition2:
X Y Z
T T F
F T F
T F F
F F T
OR At least one condition is true
X Y Z
T T T
F T T
T F T
F F F
XOR At least one condition is false
X Y Z
T T F
F T T
T F T
F F T
if not condition1 or condition2:
NOR Its either both conditions are true
X Y Z
T T T
F T F
T F F
F F F
if condition1 and condition2 or condition3 and codition4:
'''