[Tutor] if...elif question
Ignacio Vazquez-Abrams
ignacio@openservices.net
Wed, 3 Oct 2001 17:35:09 -0400 (EDT)
On Wed, 3 Oct 2001 alan.gauld@bt.com wrote:
> > > elif percent >= 60 < 70:
> > evaluates "percent>=60" and then compares that against 70.
>
> Hmm, yes, you're right since the >= and < have the same operator
> precedence it would evaluate the >= first since its leftmost.
>
> So my earlier answer is wrong in detail but right in principle.
> Apologies for any slight confusion it may have caused
> - the fix was OK tho'.
>
> To make some some amends I'll cite the page in the manuals
> with the full precedence list to save anyone looking for it...
>
> $PYTHON/Doc/ref/summary.html
Actually, if you dig around some more, you'll find that it does special-case
it.
http://www.python.org/doc/current/ref/comparisons.html
--
Ignacio Vazquez-Abrams <ignacio@openservices.net>