Your question is Prime Check With Recursion. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
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):