1. 首页
  2. 数据库
  3. 其它
  4. 代码总结Python2 和 Python3 字符串的区别

代码总结Python2 和 Python3 字符串的区别

上传者: 2020-12-23 05:29:43上传 PDF文件 41.17KB 热度 26次
Python2 >>> >>> isinstance(b'abc', bytes) True >>> >>> isinstance(b'abc', str) True >>> >>> isinstance('abc', str) True >>> >>> isinstance('abc', bytes) True >>> >>> >>> >>> 'abc'.startswith('ab') True >>> >>> b'abc'.startswith('ab'.encode()) True >>> >>> b'abc'.startswith('ab') True >>> >>> 'abc'.
下载地址
用户评论