PythonでThe Hamming Distance
コード
def checkio(n, m): num3 = format(n ^ m,"b").count("1") print num3 if __name__ == '__main__': checkio(117, 17) checkio(1, 2) checkio(16, 15)
def checkio(n, m): num3 = format(n ^ m,"b").count("1") print num3 if __name__ == '__main__': checkio(117, 17) checkio(1, 2) checkio(16, 15)