title: Optimizing Python code for Project Euler #5
body: <p>This is my solution for the 5th problem in Project Euler. Is there any way to improve the while loop conditional instead of using the sum?</p>
  
  <pre><code>table = range(1,21)
  result = 1
  pf = 2
  while sum(table) &gt; len(table):
     flag = False
     for x,y in enumerate(table):
        if y % pf == 0:
           table[x] = y/pf 
           flag = True
     if flag:
        result *= pf
     else:
        pf += 1
  print result
  </code></pre>