#!/usr/bin/python
# -*- coding: UTF-8 -*-
for b in range(2,20):
for i in range(2,b):
if(b%i == 0):break
else: print b," 是质数"
#!/usr/bin/python
# -*- coding: UTF-8 -*-
for b in range(2,20):
for i in range(2,b):
if(b%i == 0):break
else: print b," 是质数"
本文标题:python找出范围内的所有质数
本文链接:https://www.haomeiwen.com/subject/mftoxftx.html
网友评论