我正在尝试像这样使用 python 对 2 个二进制文件进行异或运算,但我的输出不是二进制文件有什么帮助吗?
I'm trying to xor 2 binaries using python like this but my output is not in binary any help?
a = "11011111101100110110011001011101000"
b = "11001011101100111000011100001100001"
y = int(a) ^ int(b)
print y
a = "11011111101100110110011001011101000"
b = "11001011101100111000011100001100001"
y = int(a,2) ^ int(b,2)
print '{0:b}'.format(y)
这篇关于如何用python异或二进制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!