On 20/03/2006 5:24 PM, Sathyaish wrote: > I) What does the following expression evaluate to? > > a < b == c > > 1) (a < b) and (b == c) > 2) (a < b) or (b == c) >
Given the common idiom in mathematics (a <= b <= c) and what it means, please contemplate which of "and" and "or" might be the more sensible/useful/plausible answer. Failing that, try to write a small script which answers your question. If that doesn't work, try reading section 5.9 (Comparisons) of the Python Reference Manual. > > 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 > Similar process: infer a plausible answer / script / see the above manual reference. -- http://mail.python.org/mailman/listinfo/python-list