Answers for "setting a condition for perfect square in python"

0

setting a condition for perfect square in python

import math

# Taking the input from user
number = int(input("Enter the 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")
Posted by: Guest on September-09-2021

Code answers related to "setting a condition for perfect square in python"

Python Answers by Framework

Browse Popular Code Answers by Language