title: Python overflowerror
body: <p>I am using Python 2.7 and I am getting the following error. How can I fix it?</p>
  
  <pre><code>for y in range(1, x/2):
  </code></pre>
  
  <p>OverflowError: range() result has too many items</p>
  
  <p>CODE:</p>
  
  <pre><code># Largest Prime Factor
  prime = True
  x = 600851475143
  pNum = 0
  for y in range(2, x/2):
      if (x % y == 0): # Found a factor
          for z in range(2, y/2): # Checking factor for prime
              if (y % z == 0): #
                  prime = False
                  break
          if (prime == True):
              pNum = y
          prime = True
  print pNum
  </code></pre>