I started learning python yesterday , and I realized I can make a perfect square checker using functions and the isinstance function. However , my code says 144 is not a perfect square. What am I doing wrong?
My Code :
def sqrt():
x = int(input("Enter a number:"))
a = x ** 0.5
return a
b = sqrt()
if isinstance ( b , int) == True:
print("It is a perfect square")
if isinstance( b , int) == False:
print("It is not a perfect square")