Working with raw binary digits.
inyeol.lee at siimage.com
Thu Feb 27 22:21:10 CET 2003
> If you want to use individual bits, just use 0 and 1, and the
> logical operators 'and', 'or', and 'not'. Roll your own nand,
> nor, etc., in terms of these.
> If you want to apply such operators to bit strings, use the
> bitwise operators &, | and ~. Roll your own nand, nor, etc., in
> terms of these.
Just a comment. If you use integer 0 and 1, be carefule using ~
operator. Use ^ instead for bit negation.
>>> 1 ^ 1
>>> 0 ^ 1
More information about the Python-list