Check if a given value is out of certain range

Ian Kelly ian.g.kelly at gmail.com
Thu Oct 1 18:03:28 EDT 2015


On Thu, Oct 1, 2015 at 3:45 PM, John Gordon <gordon at panix.com> wrote:
> In <87r3le1ht3.fsf at elektro.pacujo.net> Marko Rauhamaa <marko at pacujo.net> writes:
>> Wouldn't
>
>>    x < 0 or 10 < x
>
>> be even more visual?
>
> [SNIP]
>
> Another strike is that the code isn't consistent with itself; it puts the
> variable on the left in the first comparison, then swaps to the right for
> the second comparison.

And on the other hand, it consistently uses the < operator rather
than swapping to > for the second comparison.



More information about the Python-list mailing list