Guest User

Untitled

a guest
Nov 19th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. num = int(input("Enter a number: "))
  2. a = [i for i in range(2, num) if num % i == 0]
  3.  
  4. def is_prime(num):
  5. if num > 1:
  6. if len(a) == 0:
  7. print("PRIME")
  8. else:
  9. print("NOT PRIME")
  10. else:
  11. print("NOT PRIME")
  12.  
  13. is_prime(num)
Add Comment
Please, Sign In to add comment