def isPrime(x):
if x > 1:
for i in range(2, x):
if x % i == 0:
return False
return True
return False
print(isPrime(int(input("Enter a number: "))))
Though it returns the same output as I desired but it is not the efficient code........
So can anyone provide me the efficient code...............
Then the output will be
OUTPUT: