serega1112

check_prime

Jan 12th, 2021
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.18 KB | None | 0 0
  1. import math
  2.  
  3. res = 'prime'
  4. n = int(input())
  5. limit = n ** 0.5
  6. for i in range(2, math.floor(limit) + 1):
  7.     if n % i == 0:
  8.         res = 'composite'
  9.         break
  10. print(res)
Advertisement
Add Comment
Please, Sign In to add comment