-
Notifications
You must be signed in to change notification settings - Fork 48
/
#3_Python_Comparison_Operators.py
33 lines (29 loc) · 1.11 KB
/
#3_Python_Comparison_Operators.py
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
# Operator Description Example
# == If the values of two operands are equal, then the condition becomes true. (a == b) is not true.
# != If values of two operands are not equal, then condition becomes true. (a != b) is true.
# > If the value of left operand is greater than the value of right operand, then condition becomes true. (a > b) is not true.
# < If the value of left operand is less than the value of right operand, then condition becomes true. (a < b) is true.
# >= If the value of left operand is greater than or equal to the value of right operand, then condition becomes true. (a >= b) is not true.
# <= If the value of left operand is less than or equal to the value of right operand, then condition becomes true. (a <= b) is true.a=9
a=9
b=2
#Comparison Operation retus only boolen value (True/False)
print (a==b)
#output would be
#False
print (a!=b)
#output would be
#True
print (a>b)
#output would be
#True
print (a<b)
#output would be
#False
print (a>=b)
#output would be
#True
print (a<=b)
#output would be
#False
print (a and b)