码迷,mamicode.com
首页 > 编程语言 > 详细

Python 2 和 Python 3 的区别

时间:2018-07-15 17:33:29      阅读:148      评论:0      收藏:0      [点我收藏+]

标签:sci   编码   int   输入   raw   输出   asc   bsp   input   

Python 2:默认ASCII编码

Python 3:默认UTF-8编码

 

Python 2:输出(加)括号  print ‘abc’,print a,print(‘‘abc),print(a),加不加括号都对

Python 3:输出要加括号  print(‘abc‘), print(a)

 

Python 2:生成器  range(),xrange()

Python 3:             只有range()

 

Python 2:输入  raw_input()

Python 3:         input()

 

Python 2 和 Python 3 的区别

标签:sci   编码   int   输入   raw   输出   asc   bsp   input   

原文地址:https://www.cnblogs.com/dzc18/p/9313847.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!