首页 > 其他 > 详细

a=”hello”和b=”世界”编码成bytes类型

时间:2019-07-15 19:21:37      阅读:141      评论:0      收藏:0      [点我收藏+]

 

a="hello"
c=a.encode(encoding=utf-8)
a = bhello

b="世界"
b = b.encode(encoding=utf-8)

print(a,b,c)

输出

bhello b\xe4\xb8\x96\xe7\x95\x8c bhello
[Program finished]

 

a=”hello”和b=”世界”编码成bytes类型

原文:https://www.cnblogs.com/sea-stream/p/11190571.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!