Mega Code Archive

 
Categories / Python Tutorial / Operator
 

The Python Comparison Operators

Expression       Description  x == y           x equals y. x < y            x is less than y. x > y            x is greater than y. x >= y           x is greater than or equal to y. x <= y           x is less than or equal to y. x != y           x is not equal to y. x is y           x and y are the same object. x is not y       x and y are different objects. x in y           x is a member of the container (e.g., sequence) y. x not in y       x is not a member of the container (e.g., sequence) y.