Next: Special comparisons, Previous: Bitwise shifts, Up: Expressions [Contents][Index]
Relational expressions are:
Expression | Result |
---|---|
x < y | True if x is less than y. |
x <= y | True if x is less than or equal to y. |
x > y | True if x is greater than y. |
x >= y | True if x is greater than or equal to y. |
x = y | True if x is equal to y. |
x != y | True if x is not equal to y. |
The relational expressions apply to string as well as to numbers. When a relational operation applies to strings, case-sensitive comparison is used, e.g.:
"String" = "string" ⇒ False "String" < "string" ⇒ True