📌  相关文章
📜  判断一个数字是否是完美正方形的程序 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:54.016000             🧑  作者: Mango

代码示例1
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")