Suppose I have a number like 824 and I write it to a text file using python. In the text file, it will take 3 bytes space. However, If i represent it using bits, it has the
Have a look at struct:
>>> struct.pack("h", 824) '8\x03'