[Tutor] if...elif question

Kalle Svensson kalle@gnupung.net
Wed, 3 Oct 2001 03:33:17 +0200


[Ignacio Vazquez-Abrams]
> On Tue, 2 Oct 2001, Chris Keelan wrote:
> >     elif percent >= 60 < 70:
> It should read "elif percent>=60 and percent<70:". As you have it, it
> evaluates "percent>=60" and then compares that against 70. Since the result
> of the first is always less than 70 (either 0 or 1), it is always true.

It does?  I thought python special-cased here and evaluated it as
((percent >= 60) and (60 < 70))

Same result, anyway.

Peace,
  Kalle
-- 
[ Thought control, brought to you by the WIPO! ]
[ http://anti-dmca.org/ http://eurorights.org/ ]