Click here to Skip to main content
14,669,324 members
Rate this:
Please Sign up or sign in to vote.
See more:
def asallar(limit):
   limitn = limit+1
   asal_degil = [False] * limitn
   asal_listesi = []
   for i in range(2, limitn):
       if asal_degil[i]:
       for f in xrange(i*2, limitn, i):
           asal_degil[f] = True
   return asal_listesi

a = asallar(1000000)
print a[9999]

timeit asallar(1000000)
Updated 12-Oct-20 1:17am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100