def getPrime(b): #埃拉托斯特尼筛法
numList2 = list()
flag = [0] * b
for i in range(2,b):
if flag[i] == 0:
for j in range(i+1,b):
if j%i == 0:
flag[j] = 1
else: break
for i in range(2,b):
if flag[i] == 0:
numList2.append(i)
return numList2
网友评论