Python(二)学习笔记||二、Python的字符编码

一、Python3中字符是以Unicode编码的,中文也可以表示。

  Python2中需要加代码,指定utf-8编码
  #-*-coding:utf-8 -*-

二、encode方法

  

三、decode方法

  

 

posted @ 2019-06-21 17:33  lixinhang  阅读(176)  评论(0编辑  收藏  举报