def print_row_perc_table(table, row_labels, col_labels):
    """
    given a table, print the percentages rather than the totals
    """
    r1c1, r1c2, r2c1, r2c2 = map(float, table)
    row1 = r1c1 + r1c2
    row2 = r2c1 + r2c2

    blocks = [
        (r1c1, row1),
        (r1c2, row1),
        (r2c1, row2),
        (r2c2, row2)]

    new_table = []

    for cell, row in blocks:
        try:
            x = cell / row
        except ZeroDivisionError:
            x = 0
        new_table.append(x)

    s = print_2x2_table(new_table, row_labels, col_labels, fmt="%.2f")
    s = s.splitlines(True)
    del s[5]
    return ''.join(s)
given a table, print the percentages rather than the totals