Create a function in Python that checks if a given number is a prime.
15
def isPrime(n):
    if n < 2:
        return False
    for i in range(2, int(sqrt(n))+1):
        if n % i == 0:
            return False
    return True