#By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6^(th) prime is 13. #What is the 10001st prime number? from math import sqrt #this function will determine if # num is prime def isPrime(num): i = 2 isPr = True numSqrt = sqrt(num) while i <= numSqrt and isPr: if num % i == 0: isPr = False i += 1 return isPr primesFound = 1 i = 3 while primesFound < 10001: if isPrime(i): primesFound += 1 lastPrime = i i += 2 print "The 10001st Prime Is %d" % (lastPrime,)