素数定义:只有1和本身的因数
思路:让数字除以2到平方根的数字,取余是否为0
def prim(m, n):
arr = []
for x in range(m, n + 1):
for y in range(2, int(x ** 0.5)):
if x % y == 0:
break
else:
arr.append(x)
break
return arr
>>> print(prim(101, 200))