Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Prime Numbers :-> Sieve of Eratosthenes
#python 3.5.2 from time import time start = time() N = 999999 prime = [True for i in range(N+1)] p = 2 while (p * p <= N): if(prime[p] == True): for i in range(p*p,N+1,p): prime[i] = False p+=1 end = time() print("Total Time : ", end-start) for i in range(2,N+1): if(prime[i] == True): #print(i,end = " ") pass
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Linked list pnkj 845
Lesson8
Convert to lowercase
Add missing names
sum of odd numbers
list of primes
print path module python
Finding avg value on list
Insert a sequence of same numbers, unpacking
fb_series
Please log in to post a comment.