#NEWLINE# def dist( seq1 , seq2 ) : #NEWLINE# #INDENT# ' Hamming distance ' #NEWLINE# assert ( len ( seq1 ) == len ( seq2 ) ) #NEWLINE# if ( seq1 == seq2 ) : #NEWLINE# #INDENT# return 0 #NEWLINE# #UNINDENT# return sum ( [ ( c1 != c2 ) for ( c1 , c2 ) in zip ( seq1 , seq1 ) ] )