1
2
3
4
5
6
7
8
9
x = 'abc'

# string to bytes

b = bytes(x, encoding='utf-8')

#butes to str

s = str(b, encoding='utf-8')