What is Python?
Python is an interpreted, object-oriented, high-level programming language. It was created by Guido van Rossum in the 1980s.
You can use Python for :
Developing Desktop GUI
Websites and Web Applications
AI and Machine Learning
Who Uses Python
Python is used by :
Google( where Van Russom used to work )
Among many other organizations
Good To Know
There are two versions of Python ( Python 2 and Python 3 ). Python 2 is the legacy version of Python and it is going to be supported until the year 2020. Python 3 is the future version of Python and you are going to learn Python 3.
In this tutorial, Python will be written in Pycharm IDE (Integrated Development Environment).
In the past, there was a bit of a debate in the coding community about which Python version was the best one to learn: Python 2 vs Python 3 (or, specifically, Python 2.7 vs 3.5).
Now, in 2018, it’s more of a no-brainer: Python 3 is the clear winner for new learners or those wanting to update their skills. Here, we’ll cover why Python 3 is better, and why companies have been moving from Python 2 to 3 en [login to view URL], in 2020, should you learn Python 2 or Python 3?
A little history of Python 2 vs 3
Let’s begin with a brief timeline of Python 2 vs 3 usage.
Python 2.0 was first released in 2000. Its latest version, 2.7, was released in 2010.
Python 3.0 was released in 2008. Its newest version, 3.6, was released in 2016, and version 3.7 is currently in development.
Although Python 2.7 is still widely used, Python 3 adoption is growing quickly. In 2016, 71.9% of projects used Python 2.7, but by 2017, it had fallen to 63.7%. This signals that the programming community is turning to Python 3–albeit gradually–when developing real-world applications.
Notably, on January 1, 2018, Python 2.7 will “retire” and no longer be maintained.
What are the main Python 2 vs 3 2018 differences?
There are plenty of differences between these Python programming versions, but here are five of the main ones.
1. Python 2 is legacy, Python 3 is the future.
Since Python 2 has been the most popular version for over a decade and a half, it is still entrenched in the software at certain companies.
However, since more companies are moving from Python 2 to 3, someone who wants to learn Python programming for beginners may wish to avoid spending time on a version that is becoming obsolete.
2. Python 2 and Python 3 have different (sometimes incompatible) libraries
Since Python 3 is the future, many of today’s developers are creating libraries strictly for use with Python 3.
Similarly, many older libraries built for Python 2 are not forwards-compatible.
You may be able to port a 2.x library to 3.x., but this can be difficult and complicated; it’s definitely not a “Python for beginners” type of activity.
3. There is better Unicode support in Python 3
In Python 3, text strings are Unicode by default. 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.
This is important because Unicode is more versatile than ASCII. Unicode strings can store foreign language letters, Roman letters and numerals, symbols, emojis, etc., offering you more choices.
4. Python 3 has improved integer division
In Python 2, if you write a number without any digits after the decimal point, it rounds your calculation down to the nearest whole number.
For example, if you’re trying to perform the calculation 5 divided by 2, and you type 5 / 2, the result will be 2 due to rounding. You would have to write it as 5.0 / 2.0 to get the exact answer of 2.5.
However, in Python 3, the expression 5 / 2 will return the expected result of 2.5 without having to worry about adding those extra zeroes.