@@ -0,0 +1,1011 @@
+def hamming_distance(string1: str, string2: str) -%3E int:%0A    %22%22%22Calculate the Hamming distance between two equal length strings%0A    In information theory, the Hamming distance between two strings of equal%0A    length is the number of positions at which the corresponding symbols are%0A    different. https://en.wikipedia.org/wiki/Hamming_distance%0A%0A    Args:%0A        string1 (str): Sequence 1%0A        string2 (str): Sequence 2%0A%0A    Returns:%0A        int: Hamming distance%0A%0A    %3E%3E%3E hamming_distance(%22python%22, %22python%22)%0A    0%0A    %3E%3E%3E hamming_distance(%22karolin%22, %22kathrin%22)%0A    3%0A    %3E%3E%3E hamming_distance(%2200000%22, %2211111%22)%0A    5%0A    %3E%3E%3E hamming_distance(%22karolin%22, %22kath%22)%0A    ValueError: String lengths must match!%0A    %22%22%22%0A    if len(string1) != len(string2):%0A        raise ValueError(%22String lengths must match!%22)%0A%0A    count = 0%0A%0A    for char1, char2 in zip(string1, string2):%0A        if char1 != char2:%0A            count += 1%0A%0A    return count%0A%0A%0Aif __name__ == %22__main__%22:%0A%0A    import doctest%0A%0A    doctest.testmod()%0A

Add hamming distance (#6194)