Python versions :
Python is a general-purpose, high-level programming language.
Python language has different versions developed.
The current version of Python is 3.6
Different versions of python
There are three main versions of Python
Python 1.0:- Introduced in January 1994
Python 2.0:- Introduced in October 2000
Python 3.0:- Introduced in December 2008
Important terminology respect to the version of Python.
Software rule:- Any new version should provide support for old version programs.
But Python does not support backward compatibility.
The new version of Python does not support old version programs.
Why Python does not provide backward compatibility?
Python is the language, not implementation. Python is implemented independently based on requirements of programmer
(based on feature and functionality required) that is why Python implemented independently.
print “hello” => python 2
print(“hello”) => Python 3
print “hello” this statement is valid in Python 2 but Invalid in Python 3, because Python is not backward
Which version is better?
Python 3 is highly recommended to use because Python 3 is more powerful than Python 2.
WHAT ARE THE MAIN PYTHON 2 VS 3 2018 DIFFERENCES?
- Python 2 and Python 3 have different (Some incompatible) libraries.
- In Python 2, strings are stored as ASCII by default–you have to add a “u” if you want to store strings as Unicode in Python 2.x. In python 3, strings are Unicode by default.
- Python 2, has integer division, Python 3, has improved integer division. Example:- 5 divided by 2
In python 2, it rounds your calculation down to the nearest whole number. you will get 2 answer
In Python 3, you will get 2.5 answer
- Both versions have a different print statement.