directory
- A preface.
- Python2.x is different from python3. x
- 1. Official explanation
- 2. Grammatical differences
- 3. Coding differences
- 4. Third party reservoir area
- 3. To summarize
- Four. Guess you like it
A preface.
The Python Software Foundation has announced that it will no longer provide any support for the Python 2.x branch of the programming language by New Year’s Day 2020. This day will mark the culmination of a years-long drama: the transition from an older, less powerful, widely used version of Python to a newer, more powerful version.
However, the new version of Python still lags behind its older version in adoption. Many people will continue to use Python 2 programs for years to come, but what do you do if you’re stuck with Python 2, which is at the end of its life, as Python 3 rapidly takes over the world?
Recommended path for learning Python: Python Learning Directory >> Python Basics
Python2.x is different from python3. x
1. Official explanation
Python2.0 is a legacy of the past; Python3.0 is for future use (simplified);
2. Grammatical differences
Python2.0 print "hello" python3.0 print ("hello")Copy the code
3. Coding differences
Python2.0 cannot write Chinese directly; #-_\ -coding: UTF-8 -_\ -python3.0 can write Chinese directly; By default, Unicode supports Chinese; No more character encodings to worry about.Copy the code
4. Third party reservoir area
Many third-party libraries have changed their names. For example, when you were a kid, you were called a cutie, but now you are called a stickler!
3. To summarize
Python2.x is past tense, python3. x is present or future! So start with Python3.x when learning Python!
Four. Guess you like it
- Introduction of Python
- Python Pycharm Anacanda difference
- Python Configuration Environment
- Introduction to Python Hello World
Python2.x and python3. x, how to choose?
This article is published by the blog – Ape Say Programming Ape Say programming!