Create 3 - Primed for Takeoff.py
This commit is contained in:
parent
fded50a61a
commit
467ed5c454
10
18/3 - Primed for Takeoff.py
Normal file
10
18/3 - Primed for Takeoff.py
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
isPrime = [i%2==1 for i in range(1000001)]
|
||||||
|
isPrime[1] = False
|
||||||
|
isPrime[2] = True
|
||||||
|
l = len(isPrime)
|
||||||
|
for i in range(3, l, 2):
|
||||||
|
if isPrime[i] == False:
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
for i in range(i*2, l, i):
|
||||||
|
isPrime[i] = False
|
Loading…
Reference in New Issue
Block a user