Diagonal of a Regular Heptagon | Function to return the diagonal of a regular heptagon ; Side cannot be negative ; Length of the diagonal ; Driver code
def heptdiagonal ( a ) : NEW_LINE INDENT if ( a < 0 ) : NEW_LINE INDENT return - 1 NEW_LINE DEDENT d = 1.802 * a NEW_LINE return round ( d , 3 ) NEW_LINE DEDENT if __name__ == " _ _ main _ _ " : NEW_LINE INDENT a = 6 NEW_LINE print ( heptdiagonal ( a ) ) NEW_LINE DEDENT