關於用埃氏篩選法求素數python代碼的一些理解

源代碼 來自廖雪峯-filter 算法描述參考原文。 代碼塊如下: def _odd_iter(): # 生成一個無限序列的奇數Generator z = 1 while True: z = z+2 yield z def _not_divisible(y): # 用埃氏篩選法過濾掉奇數序列中的合數 return lambda x : x
相關文章
相關標籤/搜索