输出指定范围内的素数(质数)的个数
lower = int(input("min:"))
upper = int(input("max:"))
prime_list = []
for num in range(lower, upper + 1):# 依次循环区间内的num
if num > 1:# 判断num是否为质数
for i in range(2, num):
if (num % i) == 0:
break
else:
prime_list.append(num) # 往列表里添加num
print(num)
print(prime_list) # 打印列表
print(len(prime_list)) # 列表长度即个数
``