Standard Type Value Comparison Operators : Comparison Operators « Operator « Python Tutorial






print 2 == 2
print 2.46 <= 8.33
print 5+4j >= 2-3j
print 'abc' == 'xyz'
print 'abc' > 'xyz'
print 'abc' < 'xyz'
print [3, 'abc'] == ['abc', 3]
print [3, 'abc'] == [3, 'abc']








4.4.Comparison Operators
4.4.1.The Python Comparison Operators
4.4.2.Standard Type Value Comparison Operators
4.4.3.multiple comparisons can be made on the same line, evaluated in left-to-right order:
4.4.4.standard comparison operators return a Boolean value indicating the truthfulness of the expression