Python version2.7 vs Python version3.
Davis Onyeoguzoro
?????????????? ???????????????? ???????????????? | 2x Microsoft Certified | Computer Vision | MLOps | Generative AI
When we want to start out something new, one of the first things we do is to make a thorough research (I research everything, even what I want to buy, yes, I'm a researcher, lol). When making research in something, our 2 best options depending on your kind of person is; Google (THE KING OF DATA) - That is if you chose to read articles or read what other people's experiences are in that particular thing, read reviews and the like. Or YouTube (THE BEST STREAMING SERVICE) - If you prefer to watch videos and have a practical feel to it, it's said:
"If a picture is worth a thousand words, then?a video is worth a million".
Let's assume you're just getting started with Python, and you want to get hold of the basics, Every beginner most likely goes to YouTube to know what Python basics is, when you go on YouTube, and you look for a random Python tutorial, the teacher always advice you to go with Python 3, what some of them say most of the time is that for you to get the most out of this tutorial video, you need to use the same version of Python as they are, leaving you with a big WHY? with very little time to ponder over the question.
Why there are TWO PYTHON Versions?
To answer this, we need to go back to the beginning, where it all started. Python was invented by Guido van Rossum. In 1980, Python laid it's foundation and had it's first official release on 20 February 1991 to the public as Python version 0.9.0, but it was not until 1994 that Python released its version 1.0 with new features for functional programming, including lambda, map, filter and reduce. In the year 2000, October 16th precisely, Python version 2.0 was released, features like list comprehension was introduced. In 2008, Python version 3.0 was released with more new features, but this time around, Guido von Rossum discovered that the previous version (version 2 had loopholes).
The major problem is that Python 3 is backward incompatible. What does that mean?
Python is not backward compatible means that it will not be able to interpret everything that is originally written in Python 2. A program that runs fine in Python 2 will not work in a Python 3 interpreter. The input() function in Python 2 returns an evaluated expression of the input and tries to run it as a python code, while an input() function in Python 3 returns a String of what the user inputted.
For example
Python 2 is not forward compatible. Many older libraries created for Python 2 is not forward-compatible. Because many recent developers are creating libraries which you can only use with Python 3. At one time, there were a lot of libraries that lacked >= 3.0 support, and these were either very useful or critical to infrastructure (e.g. not just small toy programs, or scripts, but rather complicated pieces of software with lots of "moving parts"). Consequently, despite there being big advantages to using Python 3, many simply had to keep using Python 2.7. This is no longer the case - everything that matters now supports v3.
There were also other changes, such as standard library cleanups and changes in the C extension API. Since this meant that the effort of porting from Python 2 to Python 3 was much higher than previous 2.x to 2.y upgrades, it was decided to maintain 2.7 for a long time.
For many years, developers have kind of been waiting for each other. There was no point supporting 3.x with your libraries if few people used it, and there was no point trying to start using 3.x if the libraries you wanted weren’t ported…
By now, everything you might need is most likely to be ported, and it’s really just laziness that stops most Python 2.7 developers from using Python 3.6 and beyond.
The fact is, humans hate change; this was a not-insignificant factor - and still is to this day. This is even more the case in academia - many of these users will be using Python as a?tool?for their primary field of interest, rather than as software developers themselves. Consequently, they'll just keep using what has worked for them, until change is forced upon them.
On that note, I recommend whether you're just getting started or you're a Pythonista, start using Python 3. If some of your applications are running in Python 2, try migrating them to Python 3.