I have the first printing. The snippets are on pp. 159 and 160, and are 
there to illustrate the loop "else" clause.

found = 0
while x and not found:
     if match(x[0]):              # value at front?
         print 'Ni'
         found = 1
     else:
         x = x[1:]                # slice off front and repeat
if not found:
     print 'not found'


while x:                         # exit when x empty
     if match(x[0]):
         print 'Ni'
         break                    # exit, go around else
     x = x[1:]
else:
     print 'Not found'            # only here is exhausted x

"match()" seems to come out of the blue, and also "Ni". Or have I 
misunderstood something?

Thanks,

Dick Moores
[EMAIL PROTECTED]


_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to