#筛选素数
def _odd_iter():#生成器
n = 1
while True:
n = n + 2
yield n
def _not_divisible(n):#筛选器
return lambda x:x % n > 0
def primes():#生成器
yield 2
it = _odd_iter()
while True:
n = next(it)
yield n
it = filter(_not_divisible(n),it)
for n in primes():#设置跳出节点
if n < 100:
print(n)
else:
break