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:
>
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
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