Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 4.3. Comparisons
- There are eight comparison operations in Python. They all have the same priority (which is higher than that of the Boolean operations). Comparisons can be chained arbitrarily; for example, x < y <= z is equivalent to x < y and y <= z, except that y is evaluated only once (but in both cases z is not evaluated at all when x < y is found to be false).
- This table summarizes the comparison operations:
- Operation Meaning
- < strictly less than
- <= less than or equal
- > strictly greater than
- >= greater than or equal
- == equal
- != not equal
- is object identity
- is not negated object identity
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement