Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
print(bin(int("3478e392", 16))[0:] >> 22)
转换为二进制是 3478e392 = 00110100011110001110001110010010
有什么方法可以将 HEX STRING 转换为二进制,右移 22,然后逻辑和 0F?结果应返回十进制 1
试试这个:
>>> print ((int("3478e392",16)>>22)&0xf) 1