def format_h2(s, format="text", indents=0):
    """
    Encloses string in format text

    Args, Returns: see format_h1()

    >>> print("\\n".join(format_h2("Header 2", indents=2)))
      Header 2
      --------

    >>> print("\\n".join(format_h2("Header 2", "markdown", 2)))
    ## Header 2
    """

    _CHAR = "-"
    if format.startswith("text"):
        return format_underline(s, _CHAR, indents)
    elif format.startswith("markdown"):
        return ["## {}".format(s)]
    elif format.startswith("rest"):
        return format_underline(s, _CHAR, 0)
def format_h2 ( s , format = "text" , indents = 0 ) : _CHAR = "-" if format . startswith ( "text" ) : return format_underline ( s , _CHAR , indents ) elif format . startswith ( "markdown" ) : return [ "## {}" . format ( s ) ] elif format . startswith ( "rest" ) : return format_underline ( s , _CHAR , 0 )
Encloses string in format text

    Args, Returns: see format_h1()

    >>> print("\\n".join(format_h2("Header 2", indents=2)))
      Header 2
      --------

    >>> print("\\n".join(format_h2("Header 2", "markdown", 2)))
    ## Header 2