for i in range(1,10000):
for n in range(1, (i - 1)):
if ( (i % n) != 0):
print i
import math
def isPrime(n):
if n <= 1:
return False
for i in range(2,int(math.sqrt(n))+1):
if n%i == 0:
return False
return True
def hasPrime(n):
for i in range(2,n+1):
if isPrime(i):
print i
hasPrime(1000)