2018-01-10

def m():

n=1

    while True:

n=n+2

        yield n

def _not_divisible(n):

def fn(x):

return x%n>0

    return fn

def primes():

yield 2

    it = m()

while True:

n =next(it)

yield n

it=filter(_not_divisible(n),it)

for nin primes():

if n<100:

print(n)

else:

break


2018-01-10_第1张图片

你可能感兴趣的:(2018-01-10)