python hamming