Write coding to find a prime number.
Implement is_prime(n) to return True if the given integer is prime and False otherwise. A prime number is an integer greater than 1 with exactly two positive divisors.
The function accepts one integer and returns a Boolean value. Handle values less than 2 correctly and avoid unnecessary divisor checks.
def is_prime(n):