python海明距离 - 5IVI4I_I_60Y的日志 - 网易博客

时间:2014-06-11 22:00:49   收藏:0   阅读:521

python海明距离 - 5IVI4I_I_60Y的日志 - 网易博客

python海明距离  

2009-10-01 09:50:41|  分类: Python |  标签: |举报 |字号 订阅

 
 
def hammingDist(s1, s2):
    assert len(s1) == len(s2)
    return sum([ch1 != ch2 for ch1, ch2 in zip(s1, s2)])

python海明距离 - 5IVI4I_I_60Y的日志 - 网易博客,布布扣,bubuko.com

原文:http://www.cnblogs.com/lexus/p/3772389.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!