Write code to determine whether a number is prime and explain your approach.
Implement is_prime(n), which accepts an integer and returns True if it has exactly two positive divisors, otherwise False. Treat all integers less than 2 as non-prime.
def is_prime(n):