Table of Contents
show
- Comparison Operators are used to compare values
- It either returns true or false depending on the condition
- Assume a = 3 and b = 2
Example
a = 3
b = 2
print("a==b = ", a==b)
print("a!=b =",a!=b)
print("a>b =",a>b)
print("a<b =",a<b)
print("a>=b=",a>=b)
print("a<=b = ", a<=b)
Output
('a==b = ', False)
('a!=b =', True)
('a>b =', True)
('a<b =', False)
('a>=b=', True)
('a<=b = ', False)
Views: 3