On Jun 17, 3:51 pm, Back9 <backgoo...@gmail.com> wrote:
> Hi,
>
> I have one byte data and want to know each bit info,
> I mean how I can know each bit is set or not?

You want the bitwise-and operator, &.

For example, to check the least significant bit, bitwise-and with 1:

>>> 3 & 1
1
>>> 2 & 1
0
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to