python求第n个质数_找到第n个质数:麻木
我试图用埃拉霍斯特内斯的筛子找到第n个质数。是的,我看到了类似的帖子,但是我对这段代码有一个问题。一旦找到第n个素数,我就停止算法。我写的是:def nth_prime(n):limit = 10**2pn = 1 #keeps track of how many prime numbers we have foundsieve = range(3, lim...