bounslay

Untitled

May 23rd, 2023
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. new_input = int(input())
  2.  
  3. prime_numbers = []
  4. result = ''
  5. for i in range(1, new_input+1):
  6.     is_prime=True
  7.     for j in prime_numbers:
  8.         if j !=1 and i % j == 0:
  9.             is_prime = False
  10.     if is_prime:
  11.         prime_numbers.append(i)
  12.         result += "1"
  13.         print(result)
  14.     else:
  15.         result += '0'
Add Comment
Please, Sign In to add comment