Chained Comparisons

Sathyaish sathyaish at gmail.com
Mon Mar 20 01:24:07 EST 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
chain?

a < b == c > d




More information about the Python-list mailing list