Thanks guys... that works great. Now I understand why sometimes logic such as 'while not true' is used ;)
On Tue, 2005-07-12 at 10:51 -0400, Peter Hansen wrote: > rbt wrote: > > What is the appropriate way to break out of this while loop if the for > > loop finds a match? > > Define a flag first: > > keepGoing = True > > > while 1: > while keepGoing: > > > for x in xrange(len(group)): > > try: > ... > > if match == target: > > print "Collision!!!" > > print make_string > > Set the flag here, then do the break: > keepGoing = False > > > break > > Tada... > > -Peter -- http://mail.python.org/mailman/listinfo/python-list