If this is an academic exercise, write a function that turns a sequence of bytes into a bytestring (and you have to take care yourself of endianess, byte bit width, other details), to one agreeable format. You can avoid doing this if this function is written only for the read format that will be used by your professor. He'll probably mentino these details for careful students. Then devise of a function that changes a bitstring to a decimal string of the same number.