igorich1376

Prime_Digit_For_For

Aug 22nd, 2024
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. from math import sqrt
  2. # простое число или нет
  3. n = int(input())
  4. simple = True
  5. for i in range(2, int(sqrt(n)) + 1):
  6.     if n % i == 0:
  7.         simple = False
  8. if simple:
  9.     print(f'Число {n} ПРОСТОЕ!')
  10. else:
  11.     print(f'Число {n} не простое')
Advertisement
Add Comment
Please, Sign In to add comment