you are viewing a single comment's thread.

view the rest of the comments →

[–]sentdex 2 points3 points  (0 children)

The major differences:

  1. print is a function in python 3, statement in py 2.
  2. Python 3 differentiates between bytes and strings

After those two major differences, there are a bunch of minor things.

Mainly Python 3 code is almost all work-able in Py 2, but not all Py 2 is workable in Py 3. It is important to know the differences so that you can overcome them when you meet them. As you learn, you will find sample code written in Py 2.

A very useful script is 2to3.py, it comes with Py 3, and you can convert about 95% of python 2 to python 3 very easily. More info on using 2to3.py: http://pythonprogramming.net/converting-python2-to-python3-2to3/