this program will look for the next perfect square check the argument to see if it is a perfect square itself if it is not then return 1 otherwise look for the next perfect square for instance if you pass 121 then the script should return the next perfect square which is 144 alternative method works by evaluating anything nonzero as true 0 000001 true root sq0 5 return 1 if root 1 else root12 alternative method works by evaluating anything non zero as true 0 000001 true
def find_next_square(sq):
    root = sq ** 0.5
    if root.is_integer():
        return (root + 1)**2
    return -1

def find_next_square2(sq):
    
    root = sq**0.5
    return -1 if root % 1 else (root+1)**2