1. 首页
  2. 数据库
  3. 其它
  4. python2与python3的区别点

python2与python3的区别点

上传者: 2020-12-22 13:13:56上传 PDF文件 56.05KB 热度 22次
python2与python3的一些区别 1.是否需要带括号 Python2 可不带括号 1 print('hello world') 2 print 'hello lyqiu' Python3 需要括号,否则会报错 1 print('hello world') 报错信息: File "1.py", line 1 print'hello world' ^ SyntaxError: invalid syntax 2.识别中文的方式 Python2 需要设置编码方式为utf-8 # _*_ coding:utf-8 _*_ print '你好' Pyt
下载地址
用户评论