Hamming distance between two DNA strings
Your logic on the problem seems correct. The wikipedia article about the Hamming distance describes both a python and a C implementations. The python version assumes two strings of equal length:

def hamming_distance(s1, s2):
    #Return the Hamming distance between equal-length sequences
    if len(s1) != len(s2):
        raise ValueError("Undefined for sequences of unequal length")
    return sum(ch1 != ch2 for ch1, ch2 in zip(s1, s2))