is_prime(n) that returns True if n is a prime number and False otherwise, using a for loop that checks divisibility up to the square root of n for efficiency.is_prime(17)
True
17 has no divisors other than 1 and itself.
is_prime(15)
False
15 = 3 * 5.
is_prime(1)
False
By definition 1 is not prime.
Numbers less than 2 are never prime.
You only need to test divisors up to int(n ** 0.5) + 1 for efficiency, though testing all up to n-1 is also acceptable.