Quantcast
Channel: Sieve of Eratosthenes - Finding Primes Python - Stack Overflow
Viewing all articles
Browse latest Browse all 28

Answer by Saurabh Rana for Sieve of Eratosthenes - Finding Primes Python

$
0
0
def eratosthenes(n):    multiples = []    for i in range(2, n+1):        if i not in multiples:            print (i)            for j in range(i*i, n+1, i):                multiples.append(j)eratosthenes(100)

Viewing all articles
Browse latest Browse all 28

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>