Relational Operators
Relational operators are used to establish some sort of relationship between the two operands. Some of the relevant examples could be less than, greater than or equal to operators.
Python language is capable of understanding these types of operators and accordingly return the output, which can be either True
or False
.
Since 5
is less than 9
, thus the output returned is True
and False
otherwise.
The list of operators available includes:
Less than → used with <
Greater than → used with >
Equal to → used with ==
Not equal to → used with !=
Less than or equal to → used with <=
Greater than or equal to → used with >=
You can try each of the operators to practice with some numbers (or even strings).
Last updated