Using this code to take a string and convert it to binary:
bin(reduce(lambda x, y: 256*x+y, (ord(c) for c in \'hello\'), 0))
this outputs:<
This is my way to solve your task:
str = "0b110100001100101011011000110110001101111" str = "0" + str[2:] message = "" while str != "": i = chr(int(str[:8], 2)) message = message + i str = str[8:] print message