📅  最后修改于: 2022-03-11 14:46:12.105000             🧑  作者: Mango
def is_prime(n):
if n>1:
divs=[k for k in range(2,n) if n%k==0]
return len(divs)==0
else:
return False
def nth_prime(n):
primes=[p for p in range(n*n+2) if is_prime(p)]
return primes[n-1]