代码
#找出1000以内的质数-实现2
for i in range(1,1000,2):
jishu=0
for I in range(1,i//2):
if not i%I:
jishu += 1
if jishu >2:
continue
if jishu < 2:
print (i)
代码
#找出1000以内的质数-实现2
for i in range(1,1000,2):
jishu=0
for I in range(1,i//2):
if not i%I:
jishu += 1
if jishu >2:
continue
if jishu < 2:
print (i)