Python2 與 Python3 區別彙總

一  編碼方式不同   Python2默認ascill編碼    Python3編碼的默認爲utf-8。   解決方法:   在Python2 首行添加:# -*- encoding:utf-8  -*-   解決中文報錯問題。 二   三  python2 #print() print 'abc' #range() xrange() 生成器 #raw_input() python3 #pr
相關文章
相關標籤/搜索