1. 程式人生 > >python中判斷是否為完全平方數(在9999平方的範圍內)

python中判斷是否為完全平方數(在9999平方的範圍內)

# -*- coding: utf-8 -*-
"""
Spyder Editor


This is a temporary script file.
"""
num=input("Please input your number and I will answer you:\n")
key=9999
value=0
while key!=0:
    num2=int(num)
    if num2==pow(key,2):
        print("You are my destiny!!!!")
        value=1
    key-=1
if value!=1:
    print("You not belongs to me!")