"Wayne Werner" <waynejwer...@gmail.com> wrote
You probably want to add a sentinel to break out of the outer
loops too:

found = False
highscore = 0
alignment = somealignment
for x in something and not found:
     for y in somethingelse and not found:
          for z in evenmoresomething:
              if x+y+z > highscore:
                  highscore = x+y+z
                  alignment = newalignment
                    found = True
                    break

HTH,

--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/


_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to