xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

Python 3 vs Python 2 All In One

Python 3 vs Python 2 All In One

Python 3.x 与 Python 2.x 版本区别

https://www.runoob.com/python/python-2x-3x.html

image

https://www.datacamp.com/blog/python-2-vs-3-everything-you-need-to-know

如果 Python 2.x 版本想使用使用 Python 3.x 的 print 函数,可以导入 __future__ 包;
该包禁用 Python 2.x 的 print 语句,采用 Python 3.x 的 print() 函数

ASCII vs Unicode



xrange vs range()

demos

image

$ python3 --version
# Python 3.7.3
$ which python 3
# /usr/bin/python3

$ python3 ./led.py 7

$ python --version
# Python 2.7.16
$ which python
# /usr/bin/python

$ python ./led.py 7


(🐞 反爬虫测试!打击盗版⚠️)如果你看到这个信息, 说明这是一篇剽窃的文章,请访问 https://www.cnblogs.com/xgqfrms/ 查看原创文章!

refs

Python errors All In One

https://www.cnblogs.com/xgqfrms/p/17269990.html

Python 2.x

https://www.runoob.com/python/python-tutorial.html

Python 3.x

https://www.runoob.com/python3/python3-tutorial.html



©xgqfrms 2012-2021

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


posted @ 2023-03-30 18:32  xgqfrms  阅读(6)  评论(2编辑  收藏  举报