Function to check perfect square
def isPerfectSquare ( n ) : NEW_LINE INDENT if ( n < 0 ) : NEW_LINE INDENT return False NEW_LINE DEDENT root = round ( math . sqrt ( n ) ) NEW_LINE return ( n == root * root ) NEW_LINE DEDENT