Project Euler 5 in Python- Partial

def findFactor(num):
  factors = []
  x = 2
  while x < num :
    if num%x == 0 :
      try:
        if factors.index(x) >= 0 :
          break
      except ValueError:
        factors.append(x)
     
      altX = num/x
     
      try:
        if factors.index(altX) >= 0 :
          break
      except ValueError:
        factors.append(altX)
    x = x+1
    factors.sort()
    
  return factors
+Chi Hung Chan

No comments: