python_输出100:200内的素数


sushu=[]
for i in range(100,201):
    for j in range(2,i):
        if i%j==0:
            break
    if i==j+1:
        sushu.append(i)
print(sushu)

# 结果:[101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199]

 

  


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM