[Tutor] while x != 'n' or 'N' or 'l' or 'L':

Brad Chandler mbc2@netdoor.com
Wed, 6 Dec 2000 09:12:48 -0600


> while ( string.upper( x ) not in ( 'N' , 'L' ) ) :
> # body of loop here

I'm a beginner at all this, but I do think the above statement is much
clearer. However, I don't think anyone has shown how the original statement
should have looked. I know it helps me when I know why something doesn't
work, and I think I also misunderstood the same thing at one time.

The original statement:
while x != 'n' or 'N' or 'l' or 'L':

Should have been:
while x != 'n' or x != 'N' or x != 'l' or x != 'L':


Brad