import math number = int(input("Enter a number")) root = math.sqrt(number) if int(root+0.5)** 2 == number: print(number, "is a perfect square") else: print(number, "is not a perfect square") 'float' object is not callable can you help me fix the python code so I dont get this typeerror The original assignment was to create a perfect square python program and I have had so much trouble.
import math
number = int(input("Enter a number"))
root = math.sqrt(number)
if int(root+0.5)** 2 == number:
print(number, "is a perfect square")
else:
print(number, "is not a perfect square")
'float' object is not callable
can you help me fix the python code so I dont get this typeerror
The original assignment was to create a perfect square python program and I have had so much trouble.
Step by step
Solved in 4 steps with 2 images
could you help me make it a loop. I understand you would use a statement like while or else to loop. Im trying to make it so if it is not a perfect square it will prompt the user to enter another number and try again?
I still get the TypeError 'float' object is not callable. Can you help me figure out why I keep getting this error. My program is also the same as the one that was corrected.