hexadecimal calculations

matthew matthew at newsgroups.com
Fri Apr 18 19:50:56 EDT 2003


Andros wrote:
> Hello,
> how to make these hexadecimal calculations in python?
> A0 XOR 79 = D9
> D9 - A8   = 31
> 
> Thanks ;)
>
 >>> hex(0xa0 ^ 0x79)
'0xd9'
 >>> hex(0xd9 - 0xa8)
'0x31'
 >>>





More information about the Python-list mailing list