[Tutor] Python 2 Vs python 3
Cameron Simpson
cs at zip.com.au
Wed Jul 16 08:06:53 CEST 2014
On 13Jul2014 20:33, Alan Gauld <alan.gauld at btinternet.com> wrote:
>I've been using python 3 almost exclusively for the last 4 months and
>the differences are much more significant than the headlines suggest.
>In particular the module structure and naming is very different -
>enough to confuse a beginner using a Python2 tutor for sure.
>
>But there are a lot of subtle changes under the hood - extra
>options in functions for example. After about a month I gave up on my
>intention to create dual version code - it was just too much work.
Just for contrast, most of my code is dual 2.x and 3.x. That does mean at least
2.7 on occasion, and I have some code that is Python 3 only.
Like many, I'd say go with Python 3 unless you're using a tutorial that is 2.x
specific.
Aside from print being a function, you'll find the code very very similar.
There are differences, but that can be a smaller problem that you expect.
Cheers,
Cameron Simpson <cs at zip.com.au>
An ambassador is a man of virtue sent to lie abroad for his country; a news-
writer is a man without virtue who lies at home for himself.
- Sir Henry Wotton, Reliquae Wottonianae
More information about the Tutor
mailing list