r/learnpython • • Dec 18 '16

python 2 to 3

Hi, I'm about 15 lessons in to learn python the hard way and I just found out that it is outdated. My question is should I just abandon it and move to something else on the python 3 platform like automate the boring stuff with python or should I still go through with it?

10 Upvotes

8 comments sorted by

View all comments

3

u/anglicizing Dec 18 '16 edited Dec 18 '16

I'm not familiar with LPTHW, but as a general advice when it comes to the differences between python 2 and python 3... they're not that significant when it comes to learning the language.

In brief, there's some stuff happening with how python interprets string literals by default and what the str type is an alias for (in python 2 it's bytes, in python 3 it's unicode). Also the print statement has become a (superior) print function in python 3, so it needs parenthesis, and a bunch of built-ins have become iterators instead of returning lists. (Edit: and, as /u/Prooffread3r points out, the / operator starts behaving like people generally expect it to).

Learning to write and understand valid python 3 when you know python 2 is a couple of hours of work, or thereabouts. Not a big deal, compared to the amount of hours you'll spend learning the language.

So my advice is that you should first and foremost consider whether you enjoy LPTHW or not. If you do, stick with it. If you do, but want to try something else, go for it. If you don't enjoy it, try something else. If you're really unsure what to do, try something else.

2

u/woods48465 Dec 18 '16

I am enjoying LPTHW and think that I am going to continue with it and stick with 2 untill I have a decent understanding of the language. From your opinion what should i go to after I finish this

1

u/[deleted] Dec 19 '16

The book 'Learning Python' is pretty good once you start to have some familiarity with the language.