programming-examples/python/List/Python program using Sieve of Eratosthenes method for computing primes upto a specified number.py
2019-11-15 12:59:38 +01:00

10 lines
314 B
Python

def prime_eratosthenes(n):
prime_list = []
for i in range(2, n+1):
if i not in prime_list:
print (i)
for j in range(i*i, n+1, i):
prime_list.append(j)
print(prime_eratosthenes(100))';
include("../../new_editor/editor_python.php")