COMPUTING
NERDS.COM
A PLACE TO LEARN PYTHON PROGRAMMING
COMPARATIVE OPERATORS



Operators let the computer program know than an action has to occur. The three covered in this guide are: Arithmetical, Comparisson and Logical.

Below assume X = 5, Y = 6



Comparative or relational operators test the relationship between two entities. They also return either a TRUE or FALSE value. We use a double equals sign ’==’ to mean equals instead of just a single ’=’. This is because we have already used the equals sign to declare a variable. There is another operator in programming called the ’Ternary Operator’. In Python we call it a Conditional Expression. It is not covered in the scope of this guide.