basic if stuff- testing ranges

Erik Jones erik at myemma.com
Mon Nov 26 11:01:22 EST 2007


On Nov 25, 2007, at 9:49 PM, Donn Ingle wrote:

>>> if 0 > x < 20: print "within"
>> That means "if x LESS THAN 0 and x < 20".
> Oh, bugger. It's tricky.
>> So try
>>     if 0 < x < 20:
> Thanks. I was flipping signs in my tests, but I guess I flipped  
> both and got
> myself all confused.
>
>> Likely manuals: Tutorial & Reference
>> Tutorial: check contents, "if statement" looks possible, but no luck
> Yes, I got that far.
>> Reference: check contents, "comparisons" looks possible, and
> Thanks again. I find the reference is laid-out in a way that I  
> don't find
> intuitive and every time I look for something I fail. I even grep  
> through
> the folder to get a clue, which shows how poor the index is (to me)!

Then use one of the quick references here: http://rgruet.free.fr/.

Erik Jones

Software Developer | Emma®
erik at myemma.com
800.595.4401 or 615.292.5888
615.292.0777 (fax)

Emma helps organizations everywhere communicate & market in style.
Visit us online at http://www.myemma.com





More information about the Python-list mailing list