M. Clift wrote:
> But, how to I find a sequence in a list of unknown size? i.e. this
> sequence in list of other names and replace it with three others?
How about a generator?
def slice(apple, worm, new_worm):
while apple:
if worm == apple[:len(worm)]:
apple = apple[len(worm):]
yield new_worm
else:
yield [apple.pop(0)]
Jeffrey