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!")

猜你喜欢

转载自blog.csdn.net/qq_37353105/article/details/77931733