By: Ulearncoding
on April 04, 2020
/
Relational Operators
| Relational Operator | Sign | Description |
| Equal to | == | दो operands equal होते है तो ये True return करता है | |
| Not Equal to | != | दो operands equal नहीं होते है तो ये True return करता है | |
| Less than | < | left operand जब right operand से छोटा होता है तो True return करता है | |
| Greater than | > | left operand जब right operand से बड़ा होता है तो True return करता है | |
| Less than or Equal to | <= | left operand जब right operand से छोटा होता है या equal होता है तो True return करता है | |
| Greater than or Equal to | >= | left operand जब right operand से बड़ा होता है या equal होता है तो True return करता है | |
Equal to(==) Relational Operator in Python
Source Code :
a = 5
b = 6
print(a == b)
print(a == 5)
print((a<b) == (b>a))
Output :
False
True
True
Not Equal to(!=) Relational Operator in Python
Source Code :
a = 5
b = 6
print(a != b)
print(a != 5)
print((a<b) != (b<a))
Output :
True
False
True
Less than(<) Relational Operator in Python
Source Code :
a = 5
b = 6
print(a < b)
print(a > b)
Output :
True
False
Greater than(>) Relational Operator in Python
Source Code :
a = 5
b = 6
print(a > b)
print(a < b)
Output :
False
True
Less than or Equal to(<=) Relational Operator in Python
Source Code :
a = 5
b = 6
c = 5
print(a <= b)
print(a <= c)
Output :
True
True
Greater than or Equal to(>=) Relational Operator in Python
Source Code :
a = 5
b = 6
c = 5
print(a >= b)
print(a >= c)
Output :
False
True
Tag:
Python
Program Life's Admin
We are.., This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
No comments: