Comparison Operators
  • 30 Jan 2024
  • PDF

Comparison Operators

  • PDF

Article summary

Used to compare two expressions.

Syntax: result = expr1 operator expr2

Remarks: Comparison operators, also known as relational operators, compare two expressions.  The following table contains a list of the comparison operators and the conditions that determine whether result is True or False:

Operator

Meaning

True if

False if

Less than

expr1 < expr2

expr1 >= expr2

<=

Less than or equal to

expr1 <= expr2

expr1 > expr2

Greater than

expr1 > expr2

expr1 <= expr2

>=

Greater than or equal to

expr1 >= expr2

expr1 < expr2

=

Equal to

expr1 = expr2

expr1 <> expr2

<> 

Not equal to

expr1 <> expr2

expr1 = expr2

 


Was this article helpful?