1 import math 2 3 sushu = True 4 for i in range(100,300+1): 5 sushu = True 6 for j in range(2,int(math.sqrt(i))+1): 7 if i%j==0: 8 sushu = False 9 break 10 if sushu: 11 print(i)
python3输出素数
原文:https://www.cnblogs.com/zhanghx/p/9743717.html