i think this is shortest code for finding primes with eratosthenes method
def prime(r): n = range(2,r) while len(n)>0: yield n[0] n = [x for x in n if x not in range(n[0],r,n[0])]print(list(prime(r)))
i think this is shortest code for finding primes with eratosthenes method
def prime(r): n = range(2,r) while len(n)>0: yield n[0] n = [x for x in n if x not in range(n[0],r,n[0])]print(list(prime(r)))