On Sep 2, 12:51 pm, [EMAIL PROTECTED] wrote: > ... right-angled triangle puzzle solver > > max = 0 > maxIndex = 0 > index = 0 > for solution in solutions: > if solution > max: > max = solution > maxIndex = index > index += 1 > > print maxIndex
Not that it solves your slowness problem, or has anything to do with the question you asked :), but you can replace this last segment of your code with: print solutions.index(max(solutions)) -- Paul Hankin -- http://mail.python.org/mailman/listinfo/python-list