b = bytearray("test", encoding="utf-8") # here test is encoded into a byte array str1 = bytes(b) # the function bytes decodes it for us !!! print(str1) #thank god for python