一、求(2—您输入数字)之间的质数:
num = int(input("请输入您要输入的数字:"))a=[]
if num == 2:a.append(2)
elif num >2:for i in range(2,num+1):for j in range(2,i):if i %j == 0:breakelse:a.append(i)print(a)
二、求2-100之间的质数:
a = []
for i in range(2,100):for j in range(2,i):if i % j ==0:breakelse:a.append(i)
print(a)