(header, target_len=80)
Print section header
Print section header
Print section header
def print_header(header, target_len=80):
    """Print section header"""

    prefix = ""
    suffix = ""
    header_len = len(header) + 2
    remaining = target_len - header_len
    prefix_len = int(remaining / 2)
    suffix_len = int(remaining / 2)

    if (remaining % 1 == 1):
        prefix_len += 1

    for i in range(0, prefix_len):
        prefix += "-"

    for i in range(0, suffix_len):
        suffix += "-"

    print("\n" + prefix + " " + header + " " + suffix)
def print_header ( header , target_len = 80 ) : prefix = "" suffix = "" header_len = len ( header ) + 2 remaining = target_len - header_len prefix_len = int ( remaining / 2 ) suffix_len = int ( remaining / 2 ) if ( remaining % 1 == 1 ) : prefix_len += 1 for i in range ( 0 , prefix_len ) : prefix += "-" for i in range ( 0 , suffix_len ) : suffix += "-" print ( "\n" + prefix + " " + header + " " + suffix )