+ 4

What is the difference between Python 2 and Python 3?

14th Dec 2016, 8:36 AM
Jim Tanev
2 Answers
+ 9
There are differences in the some syntax
14th Dec 2016, 8:40 AM
elias sharafi
elias sharafi - avatar
+ 2
The most visible (difference) is probably the way the “print” statement works. It’s different enough that the same script won’t be able to run on both versions at the same time, but pick one and you’ll be fine. The main advantage of 3.x is that it is on the cutting edge, so all the new features will be implemented in there rather than being added to 2.x. The other thing you may want to consider is that it is the common python of the future, so looking a couple of years down the line, this will be the mature branch that people go to. Python 3 is a nicer and more consistent language, BUT, there is very limited third-party module support for it. This is likely to be true for at least a couple of years more. So, all major frameworks still run on Python 2, and will continue to do so for a significant time. Therefore, if you learn Python today, you should learn Python 2, because that is the version you are going to end up actually using.
14th Dec 2016, 8:50 AM
Vipul Walia
Vipul Walia - avatar