Click here to Skip to main content
14,661,076 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]:
           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)
Posted
Updated 12-Oct-20 1:17am
v2

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