I want to print the bit representation of numbers onto console, so that I can see all operations that are being done on bits itself.
How can I possibly do it in pyth
From Python 2.6 - with the string.format method:
"{0:b}".format(0x1234)
in particular, you might like to use padding, so that multiple prints of different numbers still line up:
"{0:16b}".format(0x1234)
and to have left padding with leading 0s rather than spaces:
"{0:016b}".format(0x1234)
From Python 3.6 - with f-strings:
The same three examples, with f-strings, would be:
f"{0x1234:b}"
f"{0x1234:16b}"
f"{0x1234:016b}"