Given a number, how would you check if it was prime with code?
Implement is_prime(n) to return True if n is prime and False otherwise. Handle numbers less than 2 and optimize the check so divisors are tested only through the square root of n.
Input is one integer n; output is a Boolean.
def is_prime(n):