9 字符串转字节

将一个字符串转换成字节类型

In [1]: s = "apple"

In [2]: bytes(s,encoding='utf-8')
Out[2]: b'apple'