- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path03-Conditional-Operators.py
More file actions
Latest commit
32 lines (21 loc) · 609 Bytes
/
Copy path03-Conditional-Operators.py
File metadata and controls
32 lines (21 loc) · 609 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
'''
Conditional Operators in Python
Conditional operators, also known as comparison operators, are used to compare two values.
They return a boolean value (True [1] or False [1]) based on the comparison.
'''
a=5
b=3
# Conditional Operator -> [0,1] [False, True]
c=a==b
print("A Equal to: B", c)
c=a!=b
print("A Not equal to: B", c)
c=a>b
print("A Greater than: B", c)
c=a<b
print("A Less than: B", c)
a=b# Reassigning b to a for comparison
c=a>=b
print("A Greater than or equal to: B", c)
c=a<=b
print("A Less than or equal to: B", c)