Distinct Primes Finder > 1000 | Python

March 15th, 2021 06:14:55 AM

					
primes=[] products=[] def prime(num): if num > 1: for i in range(2,num): if (num % i) == 0: return False else: primes.append(num) return True for n in range(30,1000): if len(primes) >= 20: break; else: prime(n) for previous, current in zip(primes[::2], primes[1::2]): products.append(previous * current) print (products)

Featured Posts