We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7f7a169 + c483a01 commit a6c10deCopy full SHA for a6c10de
primelib/primelib.py
@@ -100,15 +100,16 @@ def sieveEr(N):
100
# precondition
101
assert isinstance(N, int) and (N > 2), "'N' must been an int and > 2"
102
103
- primes = [True for x in xrange(N + 1)]
+ primes = [True for x in range(N + 1)]
104
105
- for p in xrange(2, sqrt(N) + 1):
+ for p in range(2, int(sqrt(N)) + 1):
106
if (primes[p]):
107
- for i in xrange(p*p, N + 1, p):
+ for i in range(p*p, N + 1, p):
108
primes[i] = False
109
-
+ primes[0]=False
110
+ primes[1]=False
111
ret = []
- for p in xrange(N + 1):
112
+ for p in range(N + 1):
113
if primes[p]:
114
ret.append(p)
115
0 commit comments