#!/usr/bin/python
def prime_number(n):
a = []
for i in range(1,n):
for j in range(2,int(i**0.5)+2):
if i % j == 0 and j < int(i**0.5)+1:
break
if j == int(i**0.5)+1:
a.append(i)
print a
prime_number(10000)
python学习日记-素数
最新推荐文章于 2021-04-07 12:48:52 发布