>> So how would you break out from this situation? > > finished = False > while not finished: > <do something> > for i in items: > if i > 10: > finished = True # Do not do the next while-iteration > break # and break out of the for loop > else: > <do something>
this solution is workable as well, plus it avoids having 2 break statements in the code. it "breaks" out of the while-loop in a natural way, making its conditional False. -- wesley - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "Python Web Development with Django", Addison Wesley, (c) 2009 http://withdjango.com wesley.j.chun :: wescpy-at-gmail.com python training and technical consulting cyberweb.consulting : silicon valley, ca http://cyberwebconsulting.com _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor