def main():
for n in primes():
if n < 1000:
print(n)
else:
break
def _odd_filer():
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_filer()
while True:
n = next(it)
yield n
it = filter(_not_divisible(n),it)
if __name__ == '_main_':
main()
输出只显示这一句:
>> runfile('D:/python/butaidong.py', wdir='D:/python')
>>> runfile('D:/python/butaidong.py', wdir='D:/python')
没有结果
Nelson_Zhao
相关分类