Skip to content

Instantly share code, notes, and snippets.

@nagisa
Created May 24, 2012 12:58
Show Gist options
  • Save nagisa/2781414 to your computer and use it in GitHub Desktop.
Save nagisa/2781414 to your computer and use it in GitHub Desktop.
Python 3.2.3 (default, Apr 23 2012, 23:14:44)
[GCC 4.7.0 20120414 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> bin(0x3)
'0b11'
>>> bin(0x10)
'0b10000'
>>> 0x3 | 0x10
19
>>> bin(0x3 | 0x10)
'0b10011'
>>> hex(0x3 | 0x10)
'0x13'
>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment