Why would we use Python 2 or 3?


Is there a reason to use Python 2 over Python 3, or vice versa?


In the software industry, some things take years to become the standard. Although Python 3 was released back in 2008, everyone’s code was already in production in Python 2. Given the amount of work it takes to update systems to a different version of a language, and the amount of testing it requires to ensure that a new language update offers more pros than cons, it’s no wonder that many features, programs, and libraries continue to run on Python 2. Even though Python 2 is the older version, many tasks or companies may still require that you use Python 2.

Today, Python 3 is widespread, and the differences between 2 and 3 are very easy to catch up on. Learning Python 3 will be a matter of learning a handful of differences in syntax and functionality - the fundamentals are all the same, and adapting your learning from one to the other is relatively simple. If you want to learn Python 2 and then add or switch to Python 3, don’t worry, you will be in good company! With reading and practice, particularly with developer documentation, you can pick up Python 3 quickly.

As of October 2019, Codecademy Pro on Python teaches Python 3 – this includes the Pro Computer Science and Data Science Paths and multiple skill paths. Paths and include content from the core Python 3 course as well as deeper and broader material on Python to help with the Path outcome (e.g. different instruction with applying Python for data science vs. computer science). Codecademy’s older free course, Learn Python 2, teaches Python 2.x. Early access to new courses is one of the benefits of being a Pro member, and Codecademy Pro has a free 7 day trial if you want to try before you buy.

If you’re curious to learn more, here’s Python’s very own documentation on the differences and what’s new in version 3!


Consider also, proposed 2.7 end of life (EOL)


It borders on irresponsible to suggest anyone start any project (or even support one) that uses Python 2 at this point. In 2020 all support to be discontinued (after already being prolonged in 2014, when it was originally supposed to end). At this point all the major libraries (TensorFlow, etc.) are implemented in Python 3.

Python 2 can be downright dangerous to teach to beginners because of integer division (not to mention lack of unicode string support). It is not just print() and input() that have changed.


If is dangerous, I am wondering why Codeacademy has Python 2 for beginners. I wish everyone that decide to teach would have a common decision. I am new to Python and I bought a book called Hello World, Computer Programming for kids and other beginners, 2nd edition and unfortunately the author decided to go for Python 2.


Because at the time it was much better supported with more modules and libraries. It is still the basis of the language and it is never harmful to know the earlier iterations of a language, even while they are going out of vogue and riding into the sunset.

Beginners are not writing production code, but are learning syntax, keyword usage, program constructs, data structures, variables, etc. It is not dangerous at all if one is learning and applying what they learn. Adapting to the current version of the language is a simple matter if they have taken seriously what they have learned and followed up with lots of reading and practice.


Thank you, that is what I thought. It is not dangerous.


From a standpoint of bullet proof code in a production setting facing the web, it stands to good reason that the most recent version is ported to the site. In-house code should meet the latest standards at all times.

For our purposes, though, we need not concern ourselves at this point with the issues that may come with version 2 that are addressed in version 3. If one is supremely interested, then there is ample reading material available online. Look for papers written by professionals as opposed to just opinion blogs or forums (that they may be one in the same notwithstanding).


thanks a lot i just get it


I completed some Python lessons at CodeAcademy Pro in September 2019, before the stated October 2019, so then does this mean that the lessons have been updated/changed since then?

If so, how can I find out which lessons have been updated so I can go back and relearn?

python is the easiest language with whom i have ever met (;

why is Python 3 for pro? Python 3 is the most widely used one now and we’re only allowed to learn Python 2? Seriously?


If you are a beginner then I would suggest you to just learn Python3 as Python3 will take over Python2 by 2020. But, if you are interested in just the differences than I can tell you a few common difference a beginner should know like - Python 2 vs Python 3 :

  • In Python2 print is like a command but in Python3 print() is a function
  • In Python2 the integer divide works in C/C++ style but Python3 will return the expected result. For example, In Python2 7/2 will return 3 but in Python3 it will return 3.5
  • In Python 2, a string is by default ASCII. But in Python3 string is by default Unicode