xxxxxxxxxx
b = bytearray("test", encoding="utf-8") str1 = bytes(b) print(str1)
xxxxxxxxxx
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