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)])
本文标题:汉明距离
本文链接:https://www.haomeiwen.com/subject/rhqnbftx.html
网友评论