multiple comparisons can be made on the same line, evaluated in left-to-right order: : Comparison Operators « Operator « Python Tutorial






print 3 < 4 < 7           # same as ( 3 < 4 ) and ( 4 < 7 )
print 4 > 3 == 3          # same as ( 4 > 3 ) and ( 3 == 3 )
print 4 < 3 < 5 != 2 < 7








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