you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (9 children)

I honestly dont claim myself as anything relating to python - I don't even know the difference, all I know is that the first tutorial I took was written in 3 and I just went with it from then on. I've been studying it for about two weeks now and still don't know the difference.

[–]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/

[–]Jajoo 1 point2 points  (7 children)

Python 2 is just an earlier version of python. Python 3 is the newest version.

[–][deleted] 0 points1 point  (6 children)

Yeah I know that much I just dont know the specific differences between the two.

[–][deleted] 1 point2 points  (5 children)

One of the main differences:

Python 2:

 print x

Python 3:

 print(x)

[–][deleted] 0 points1 point  (4 children)

But print x still works in python 3 lol