prime_checker.py 506 B

123456789101112131415161718192021222324
  1. #Write your code below this line 👇
  2. def prime_checker(number):
  3. indicate_strings = [
  4. "It's a prime number.",
  5. "It's not a prime number."
  6. ]
  7. is_prime = True
  8. for i in range(2, number):
  9. if number % i == 0:
  10. is_prime = False
  11. if is_prime:
  12. print(indicate_strings[0])
  13. else:
  14. print(indicate_strings[1])
  15. #Write your code above this line 👆
  16. #Do NOT change any of the code below👇
  17. n = int(input("Check this number: "))
  18. prime_checker(number=n)