def hamming(correct, observed):
    """
    Calculates hamming distance between correct code and observed code with possible errors
    Args:
        correct: the correct code as list (binary values)
        observed: the given code as list (binary values)
    Returns:
        distance: the hamming distance between correct and observed code
    """
    distance = 0
    for i in range(len(correct)):
        if correct[i] != observed[i]:
            distance += 1
    return distance