Modify the following code in Python to check if a number is prime or not.
def checkPrime(n):
    for i in range(2,n):
        if n%i==0:
            return False
    return True
def checkPrime(n):
    if n <= 1:
        return False

    for i in range(2,n):
        if n % i == 0:
            return False
    
    return True