Check if a given value is out of certain range

Laxmikant Chitare laxmikant.general at gmail.com
Tue Sep 29 00:46:04 EDT 2015


Hi,

I know there is an elegant way to check if a given value is within certain
range.
Example - To check if x is between zero and ten, I can do 0 < x 10.

Is there any similar elegant way to check if a value is out of certain
range?
Example - To check if x is either less than zero or greater than ten?
Right now I am using x < 0 or x > 10.

Regards,
Laxmikant
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20150929/8bb35893/attachment.html>


More information about the Python-list mailing list