Bitwise Operations

Ulrich Eckhardt ulrich.eckhardt at dominolaser.com
Tue Jul 30 02:20:06 EDT 2013


Am 30.07.2013 01:34, schrieb Devyn Collier Johnson:
> Typing "101 & 010" or "x = (int(101, 2) & int(010, 2))" only gives errors.

What errors? Check out Eric Raymond's essay on asking smart questions, 
it's a real eye-opener! ;)

That said, use "0b" as prefix for binary number literals (0b1000 is 
eight, for example).

Cheers!

Uli





More information about the Python-list mailing list