def asallar(limit):
limitn = limit+1
asal_degil = [False] * limitn
asal_listesi = []
for i in range(2, limitn):
if asal_degil[i]:
continue
for f in xrange(i*2, limitn, i):
asal_degil[f] = True
asal_listesi.append(i)
return asal_listesi
a = asallar(1000000)
print a[9999]
timeit asallar(1000000)
What I have tried:
Changed title in hopes trolls may avoid this post