Advertisement
Guest User

PythonL

a guest
Dec 8th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | None | 0 0
  1. n = 120
  2. tab = [False, False]
  3. for i in range(2,n+1):
  4.     tab.append(True)
  5.  
  6. i = 2
  7. while i*i <= n :
  8.     if tab[i]:
  9.         for j in range(i*i,n*i):
  10.             tab[j] = False
  11.     i += 1
  12.  
  13. for i in range(n):
  14.     if tab[i]:
  15.         print(i)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement