汉明距离
2018-08-16 本文已影响0人
GengJianQi
def hanming(x, y):
if len(x) != len(y):
raise ValueError("Unequal length")
return sum([i != j for i, j in zip(x, y)])
def hanming(x, y):
if len(x) != len(y):
raise ValueError("Unequal length")
return sum([i != j for i, j in zip(x, y)])