def hamming_distance(target, test):
    """
    Calculate the hamming distance between two tuples.

    Arguments:
        target (tuple): the target tuple.
        test (tuple): the test tuple. Must have same length as target

    Returns:
        int: the hamming distance
    """
    dist = 0
    assert len(target) == len(test), "Tuples must have the same length in the \
        calculation of hamming distance!"
    for target_entry, test_entry in zip(target, test):
        if target_entry != test_entry:
            dist += 1
    return dist