作用:python3.x里默认的str是(py2.x里的)unicode, bytes是(py2.x)的str, b”“前缀代表的就是bytes python2.x里, b前缀没什么具体意义, 只是为了兼容python3.x的这种写法 https://www.cnblogs.com/single-boy/articles/7562534.html https://blog.csdn.net/sinat_40292249/article/details/96431295 http://blog.sciencenet.cn/blog-3428464-1247188.html https://www.jianshu.com/p/19c74e76ee0a https://blog.csdn.net/weixin_42989523/article/details/81873874 Python3的执行过程在看实际代码的例子前,我们来聊聊,python3 执行代码的过程
Python3有两种表示字符序列的类型:bytes和str。前者的实例包含原始的8位值,后者的实例包含Unicode字符。Python2也有两种表示字符序列的类型,分别叫做str和Unicode,与Python3不同的是,str实例包含原始的8位值;而unicode的实例,则包含Unicode字符。 |
|