I was curious – if Python 3 is so widely spread, why Ubuntu applications still use python 2?
I have started to learn this language, and I am surprised that some application code I see uses python 2.7.x and when run in python 3 interpreter mostly causes fatal errors.
Should I concentrate on learning Python 2 instead or I have misunderstood something?
Many places with a currently working code base still use Python v 2.x since some third-party software/libraries haven’t been brought up to Python v3.x yet, but the move to v3 is inevitable in the long run.
Your Python 2 code may not work under v 3 depending on what you are doing. Here is What’s New in Python 3 so you can see some of the differences yourself (Also take a look at the helpful link @Mark posted above).
If you are starting out to learn Python from scratch and don’t need access to 3rd party libraries that only work with v2 I would go ahead and learn v3, otherwise learning v2 is fine. The differences between v2 and v3 can be worked out without too much trouble down the line if needed and since most what you learn about programming with Python will still apply.