天天看点

Codewars-You‘re a square!(Python)

解法一:
def is_square(n):    
    if n<0:
        return False
    elif n == 0:
        return True
    else:
        i = 1
        while i < n:
            m = i*i
            if m == n:
                return True
            elif m>n:
                return False
            else:
                i+=1