import math
maks=18
tab = []
for i in range(2, maks + 1):
tab.append(i)
end = int(math.sqrt(maks))
for j in range(2, end + 1):
for c in range(len(tab)):
if tab[c]%j ==0 and tab[c] != j:
del tab[c]
错误:
如果tab [c]%j == 0并且tab [c]!= j:
IndexError:列表索引超出范围