Write a function to judge if a number is a prime number.
Implement is_prime(n), which accepts an integer and returns True if n has exactly two positive divisors, 1 and itself. Otherwise, return False. Values less than 2 are not prime. The solution should avoid testing divisors greater than the square root of n.
ndef is_prime(n):