A War Dragons feature needs to classify integer values as prime or non-prime. Implement is_prime(n) using trial division, then rewrite the divisor-checking logic recursively without changing the function's behavior.
A prime number is an integer greater than 1 with no positive divisors other than 1 and itself. You only need to test divisors through the square root of n.
n.True if n is prime; otherwise return False.0 and 1 as non-prime.is_prime must use recursion to test candidate divisors.def is_prime(n):