This is my code. I'm trying to make an efficient but simple Sieve of Erasthotenes but when I run the program it just keeps returning integers, however large i put the range. This is in python 3.
lyst = []
for i in range(2, 100):
print(i)
lyst.append(i)
count = 2
index = 1
for x in lyst:
print(str(index) + " : " + str(count))
if x%count == 0 and x != count:
lyst.remove(x) #removing all multiples of count
if max(lyst) == count: #breaks loop if count is the largest prime
break
else:
count = lyst[lyst.index(count)+1] #turns count into next prime
index += 1 #this is just for me to track how many primes i've found