a = 'ddd'.encode("utf8") print(type(a)) # <class 'bytes'> 字符串变成字节 a = b'ddd'.decode('utf-8') print(type(a)) #<class 'str'> 字节变成字符串
a = 'ddd'.encode("utf8") print(type(a)) # <class 'bytes'> 字符串变成字节 a = b'ddd'.decode('utf-8') print(type(a)) #<class 'str'> 字节变成字符串