Jul-07-2020, 11:11 AM
Hi everyone! I am trying to find 1000th prime number with this function, there is no any errors but it doesn't run and I don't know why. Can you help me?
import sys def thousandprime(): for i in range(sys.maxsize**10): primes = [] if i % 2 != 0 and i % 3 != 0 and i % 5 != 0 and i % 7 != 0: primes.append(i) elif len(primes) == 1000: print(primes[-1]) return thousandprime()