def parse_errors(nodes, errors):
    """Count errors in nodes.
    Args
        nodes: list of tuples of two items
        errors: dict representing error values
    Returns
        Tuple (int of key erros, int of val errors, string of error output).
    """
    key_errors = len([1 for fst, snd in nodes if snd == errors['key_str']])
    val_errors = len([1 for fst, snd in nodes if snd == errors['val_str']])

    output = 'Key Errors:\t' + str(key_errors)
    output += '\nValue Errors:\t' + str(val_errors)
    return key_errors, val_errors, output