[Tutor] 'if a==b or a==c or a==d' alternative (was: pausing a nd layout)

Scot Stevenson scot@possum.in-berlin.de
Tue Jan 7 18:31:47 2003


Hello Alan, 

>   if p in 'Qq ':
>       sys.exit()

> saves a few quote signs...

I've just looked thru the new stuff on Python 2.3, and it seems that it will 
support larger subsplices, so that

if 'ab' in 'abcdefg':
    print 'found'

will actually print 'found'. Which  means that the above example would do a 
sys.exit() if the user types 'Qq'.

Okay, that's probably not going to ruin your party, but in other cases it 
might be a nasty side effect one of these days.

Y, Scot

-- 
  Scot W. Stevenson -- scot@possum.in-berlin.de -- Zepernick, Germany