title: [Python/Project Euler]Problem 41
body: <p>I am trying to solve <a href="http://projecteuler.net/index.php?section=problems&amp;id=41" rel="nofollow noreferrer">problem 41</a>, but i don't know why my code stops at 987654319:</p>
  
  <pre><code>def IsPandigital(No):
   a = sorted(str(No))
   for i in range(1,10):
    if a[i - 1] != str(i):
     return False
   return True
  def IsPrime(No):
   i = 2
   while i &lt; No:
    if No % i == 0:
     return False
    i += 1
   return True
  i = 987654321
  while i &gt; 0:
   print i
   raw_input()
   if IsPrime(i) == True and IsPandigital(i) == True:
    print i
    break
   i -= 1
  print i
  print "EOP"
  raw_input()
  </code></pre>
  
  <p>P.S: I know that i should start from 799999999 because:</p>
  
  <blockquote>
    <p>GergS: Every 9 digit and 8 digit pandigital number is divisible by 3.</p>
  </blockquote>