primes > 1000 | Python

austinleath

February 9th, 2021 02:17:01 AM

					
def isPrime(n): for i in range(2,int(n**0.5)+1): if n%i==0: return False return True sumSet = set() primeSet = set() for i in range(2,1000): #1 isn't prime if isPrime(i): for primeNumber in primeSet: sumSet.add(primeNumber+i) sumSet.add(i+i) primeSet.add(i) print(sumSet.issuperset(range(4,1000,2)))

Featured Posts