fork download
  1. # your code goes here
  2. def is_prime(x):
  3. if x == 1:
  4. return False
  5. i = 2
  6. while i*i <= x:
  7. if x % i == 0:
  8. return False
  9. i += 1
  10. return True
  11.  
  12. numtest = int(input())
  13. count = 1
  14. while count <= numtest:
  15. f1 = int(input())
  16. if is_prime(f1):
  17. print("Prime")
  18. else:
  19. print("Not Prime")
  20. count = count + 1
Success #stdin #stdout 0.01s 27664KB
stdin
3
123321
123
103
stdout
Not Prime
Not Prime
Prime