Python Comparison Operators
Python Comparison Operators
Comparison operators are used to compare two values:
Operator | Name | Example | Try it |
---|---|---|---|
== | Equal | x == y | Try it » |
!= | Not equal | x != y | Try it » |
> | Greater than | x > y | Try it » |
< | Less than | x < y | Try it » |
>= | Greater than or equal to | x >= y | Try it » |
<= | Less than or equal to | x <= y | Try it » |