daily pastebin goal
35%
SHARE
TWEET

Untitled

a guest Mar 23rd, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. n = int(input())
  2. a = list(range(n + 1))
  3. a[1] = 0
  4. for i in a:
  5.     if i:
  6.         for j in range(2 * i, n + 1, i):
  7.             a[j] = 0
  8. print(*[x for x in a if x])
  9. input()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top