[Tutor] Help with Guess the number script

Mark Lawrence breamoreboy at yahoo.co.uk
Mon Mar 10 10:25:46 CET 2014


On 10/03/2014 02:05, Scott W Dunning wrote:
>
> On Mar 8, 2014, at 7:35 AM, Mark Lawrence <breamoreboy at yahoo.co.uk> wrote:
>>
>> I have no interest in the efficiency, only what is easiest for me to read, which in this case is the chained comparison.  As a rule of thumb I'd also prefer it to be logically correct :)
>>
> What exactly is ment by a chained comparison?  Wouldn’t what I wrote be chained?
>

A chained comparison refers to the fact that the comparison can be 
written without using and or or, see 
http://docs.python.org/3/reference/expressions.html, not the if/elif chain.

-- 
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.

Mark Lawrence

---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com




More information about the Tutor mailing list