Answers for "python check if a number is a perfect square"

2

check if a number is perfect cube in python

x = int(input())
print(int(round(x ** (1. / 3))) ** 3 == x)
Posted by: Guest on August-24-2020
0

how to check if a number is a perfect square 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 "python check if a number is a perfect square"

Python Answers by Framework

Browse Popular Code Answers by Language