Re: [Tutor] Strange "snippets" in Learning Python, 2nd ed.

2005-08-20 Thread Kent Johnson
Dick Moores wrote: > 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: >

Re: [Tutor] Strange "snippets" in Learning Python, 2nd ed.

2005-08-20 Thread Andrei
Dick Moores wrote: > I have the first printing. The snippets are on pp. 159 and 160, and are > there to illustrate the loop "else" clause. > while x: # exit when x empty > if match(x[0]): > print 'Ni' > break# exit, go around else

[Tutor] Strange "snippets" in Learning Python, 2nd ed.

2005-08-20 Thread Dick Moores
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