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.
1 parent f1dd08c commit 6f368a0Copy full SHA for 6f368a0
SieveOfEratosthenes.py
@@ -3,7 +3,7 @@
3
numlist = range(2,x+1)
4
for num in numlist:
5
p = 2
6
- while p < numlist[-1]:
+ while p*num < numlist[-1]:
7
if (p * num) in numlist:
8
numlist.remove(p * num)
9
p = p + 1
0 commit comments