10001st prime


In [2]:
primes = []
current_number = 0
while len(primes) < 10001:
    prime = True
    for x in xrange(1,11):
        if current_number % x == 0:
            prime = False
        
    if prime == True:
        primes.append(current_number)
        
    current_number += 1

print len(primes)
print primes


---------------------------------------------------------------------------
KeyboardInterrupt                         Traceback (most recent call last)
<ipython-input-2-117859c41b27> in <module>()
      3 while len(primes) < 10001:
      4     prime = True
----> 5     for x in xrange(1,11):
      6         if current_number % x == 0:
      7             prime = False

KeyboardInterrupt: