One of the first things you will notice when you get started with Python its that there are two versions out there, Python 2 and Python 3. As you may have guessed Python 3 is the newest version, and it fixes fundamental design flaws in Python 2. It is already 10 years old so why does not everybody use it yet? The main reason is that Python 3 is not backwards compatible. Anyone working on projects with a codebase in Python 2 would probably want to stay with Python 2 rather than convert their code to Python 3.
So which one is right for you?
If you are just getting started with Python I suggest you go with Python 3. If you are working on legacy code you may want to stay with Python 2.x for now (support ends in 2020), but for any other reason you should go with Python 3.
Python 3 adoption rate 2017
53 % of developers reported to be using Python 3 and 47 % were still using Python 2 according to Developer Ecosystem Survey 2017
Some fundamental changes in Python 3
- print is now a built-in function, not a statement..
- In Python 3 the input is always returned as a string (like raw_input in Python 2), not evaluated as an expression.
- Support for optional function annotations is added.
- An immutable
bytes type and a mutable
bytearray type is introduced.
- Backward-compatibility features were removed, including old-style classes, string exceptions, and implicit relative imports.
- Integer division is changed:
3 (in Python 2 both expressions would return
For a complete list of changes dive into the Python documentation.
Which version of Python are you using, and why? Let us know in the comments!