Skip to content

Instantly share code, notes, and snippets.

@yuvipanda
Created January 16, 2010 10:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuvipanda/278775 to your computer and use it in GitHub Desktop.
Save yuvipanda/278775 to your computer and use it in GitHub Desktop.
import math
def is_prime(n):
for i in range(2, int(math.sqrt(n)) + 1):
if n % i == 0:
return False
return True
cur_no = 1
count = 0
while count < 10001:
cur_no += 1
if is_prime(cur_no):
count += 1
print cur_no
print "10001th prime is", cur_no
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment