def nums while yield def is_prime for div in xrange if div continue if

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
def nums(n=1):
while 1:
yield n
n += 1
def is_prime(n):
for div in xrange(2,9):
if n == div: continue
if n % div == 0: return False
return True
def primes():
for g in nums(2):
if is_prime(g):
yield g
primes_gen = primes()
[primes_gen.next() for i in xrange(1,10002)][-3:]