For this Question: Given an integer N, find the closest prime number to N. If there are multiple print the smaller one.The input contains a single integer N.

Constraints:
1 <= N <= 1000000000Print the closest prime to N.Sample Input 1
12

Sample Output 1
11

Explanation: Closest prime to 12 is 11 and 13 smaller of which is 11.

Sample Input 2
17

Sample Output 2
17

Explanation: Closest prime to 17 is 17., I have written this Solution Code: from math import sqrt
def NearPrime(N):
    if N >1:
        for i in range(2,int(sqrt(N))+1):
            if N%i ==0:
                return False
                break
        else: return True
    else: return False    

N=int(input())
i =0
while NearPrime(N-i)==False and NearPrime(N+i)==False:
    i+=1
    
if NearPrime(N-i) and NearPrime(N+i):print(N-i)
elif NearPrime(N-i):print(N-i)
elif NearPrime(N+i): print(N+i), In this Programming Language: Python, Now tell me if this Code is compilable or not?