##第一种
import math
num = []
i = 2
for i in range(2, 100):
j = 2
for j in range(2, i):
if(i % j == 0):
break
else:
num.append(i)
print(num)
##第二种
import string
def prime(num):
sushu = {}
for i in range(0, num+1):
sushu[0] = False
sushu[1] = False
sushu[2] = True
sushu[3] = True
for j in range(2, i-1):
if(i % j == 0):
sushu[i] = False
break
else:
sushu[i] = True
if sushu[i]:
print(i, end=" ")
prime(100)
</