Chained Comparisons

Sathyaish sathyaish at
Mon Mar 20 07:24:07 CET 2006

I) What does the following expression evaluate to?

a < b == c

1) (a < b) and (b == c)
2) (a < b) or (b == c)

II) How many operands can be chained for comparison in a single
expression? For e.g, is the under-stated expression a valid comparison

a < b == c > d

More information about the Python-list mailing list