Devyn Collier Johnson wrote:

> On Python3, how can I perform bitwise operations? For instance, I want
> something that will 'and', 'or', and 'xor' a binary integer.

>>> 0b1010 | 0b1100
14
>>> bin(_)
'0b1110'
>>> 0b1010 & 0b1100
8
>>> bin(_)
'0b1000'
>>> 0b1010 ^ 0b1100
6
>>> bin(_)
'0b110'


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to