def print_vars(vars, upper=False, convert=False):
    # Allow passing in of single or multiple lists
    if isinstance(vars[0], str) and len(vars) == 2:
        is_single = True
        # Format the list appropriately
        vars = [vars]
    else:
        is_single = False
    for var in vars:
        if len(var) != 2 and not is_single:
            raise TypeError('Need both title and variable.')
        title, data = var
        if isinstance(data, list) and convert:
            if len(data) > 1:
                data = ''.join(map(str, data))
        elif upper:
            title = title.upper()
        print('{}: {}'.format(title, data))
Single line print with variable and a title, as well
dataset/ETHPy150Open christabor/MoAL/MOAL/helpers/display.py/print_vars