Find length of Diagonal of Hexagon | Function to find the diagonal of the hexagon ; side cannot be negative ; diagonal of the hexagon ; Driver code
def hexadiagonal ( a ) : NEW_LINE INDENT if ( a < 0 ) : NEW_LINE INDENT return - 1 NEW_LINE DEDENT return 2 * a NEW_LINE DEDENT if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT a = 4 NEW_LINE print ( hexadiagonal ( a ) ) NEW_LINE DEDENT