python2x与python3x的区别

python2x与Python3x的区别

 一.1.Python2x:  a.源码不规范,源码混乱,重复代码冗余(重复多)

     python3x:  b.重整源码,源码规范,优美,清新,简单

  2.Python2x:  a.默认编码方式是 ASCII(对待中文需要加)

     python3x:  b.默认编码方式是utf-8

  3.Python2x:  a.range是list类型   xrange才是可迭代对象

        python3x:  b.range可以视为list可迭代对象(不是list类型)

  4.Python2x:  a.客户交互raw_input 而Python2x中的 input() 相当于eval()

        python3x:  b.客户交互input

  5.Python2x:  a.print "内容"   或者   print(“内容”) 

        python3x:  b.print(“内容”)#如果是变量,不用带引号

posted @ 2018-04-28 19:23  pupilheart  阅读(256)  评论(0编辑  收藏  举报
小强带你挣小钱v:zln88896

公告

点击 更新中