def get_su_num(start,end):
a = []
end = end + 1
for n in range(start,end):
count = 0
for m in range(1,n):
if n%m == 0:
count = count + 1
if count <= 1 and n != 1:
a.append(n)
return a
print(sum(get_su_num(1,100)))
def get_su_num(start,end):
a = []
end = end + 1
for n in range(start,end):
count = 0
for m in range(1,n):
if n%m == 0:
count = count + 1
if count <= 1 and n != 1:
a.append(n)
return a
print(sum(get_su_num(1,100)))
本文标题:求素数和作业
本文链接:https://www.haomeiwen.com/subject/wwkuzqtx.html
网友评论