def ham_dist(e1, e2):
 ne = operator.ne
 return sum(imap(ne, e1, e2))

def ham_dist ( e1 , e2 ) : ne = operator . ne return sum ( imap ( ne , e1 , e2 ) )
computes hamming distance between two strings e1 and e2 .