Skip to content

Commit 6f368a0

Browse files
committed
Update SieveOfEratosthenes.py
Updated while condition
1 parent f1dd08c commit 6f368a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

SieveOfEratosthenes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
numlist = range(2,x+1)
44
for num in numlist:
55
p = 2
6-
while p < numlist[-1]:
6+
while p*num < numlist[-1]:
77
if (p * num) in numlist:
88
numlist.remove(p * num)
99
p = p + 1

0 commit comments

Comments
 (0)