for i in range(2,101):
j = 2
while j < i:
if i % j == 0:
break
j += 1 # i % j == 0不成立,j = j+1,然后在比较j < i
else:
print(‘素数有:%d‘ % i)
标签:microsoft log python bre pre size += span pytho
for i in range(2,101):
j = 2
while j < i:
if i % j == 0:
break
j += 1 # i % j == 0不成立,j = j+1,然后在比较j < i
else:
print(‘素数有:%d‘ % i)
标签:microsoft log python bre pre size += span pytho
原文地址:https://www.cnblogs.com/laosun0204/p/8676383.html