Hi all,

I have to convert a hex byte [eg: 0x2A] into its binary form [eg:00101010].
The input is always only one byte that is 8 bits.

I tried using pack() and unpack(). But i am unable to get desired results.

The desired output should look like the following:

0x0a => 00001010
0x23 => 00100011

Can anyone suggest me for the same?

Reply via email to