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

alan.gauld@bt.com alan.gauld@bt.com
Wed, 6 Dec 2000 16:26:33 -0000


> Subject: [Tutor] while x != 'n' or 'N' or 'l' or 'L':
> I think theres a problem in the line that reads the same as 
> the title of this message, 

try this instead:

while x not in 'nNlL':
    # do it here

You method would require separate tests for each entry:

while (x!='n') and (x != 'N) and....


Alan G.