17-编码:UTF-8 字节长度
语法讲解
今天学: encode 后按字节计数
print(len("猫".encode("utf-8")))
print(len("猫咪".encode("utf-8")))
小练习
运行下面代码后输出是什么?(多行输出请按真实换行提交)
print(len("猫".encode("utf-8")))
print(len("猫咪".encode("utf-8")))
提交要求: 只提交最终输出结果,不要添加多余的说明或引号。
今天学: encode 后按字节计数
print(len("猫".encode("utf-8")))
print(len("猫咪".encode("utf-8")))
运行下面代码后输出是什么?(多行输出请按真实换行提交)
print(len("猫".encode("utf-8")))
print(len("猫咪".encode("utf-8")))
提交要求: 只提交最终输出结果,不要添加多余的说明或引号。
全部评论