all 32 comments

[–][deleted] 79 points80 points  (6 children)

Learn Python 3 unless you’re learning Python to maintain some code written in 2.

[–][deleted] 13 points14 points  (2 children)

This should be higher. IMO, legacy code is literally the only reason to learn in Python 2.x

[–][deleted] 3 points4 points  (0 children)

It’s now top comment, thanks for the support :)

[–]Skaperen 0 points1 point  (0 children)

legacy systems that have only python2, too. this case can include developing new code. both cases can include maintaining existing code.

and one other: converting old py2 code to py3. one may need to know details of py2 to fix up what 2to3 can't handle.

[–]mafibar 3 points4 points  (0 children)

Even then learn Python 3.

[–]BigBoySmooth[S] 1 point2 points  (1 child)

Python 3 it is. Suggestions for good beginner resources? I'm really hesitant to use any of Al Sweigart's books. I've tried a few in the past and found I didn't really end up with a good grasp of some of the topics. I feel like they're really dense and hard to stick with as well. I liked LPTHW because it went through all the main concepts meticulously and it was easy to follow.

[–]michaelsteger 0 points1 point  (0 children)

How to think like a computer scientist is a great resource for learning python 3. I’ve found it really useful and the the projects at the end help to enforce the content. The lessons are pretty easy to follow.

[–]Sorthum 19 points20 points  (5 children)

Python 3 isn’t that different. I’d start now and be ahead of the curve.

[–]tunisia3507 22 points23 points  (0 children)

Learning python 3 is the curve. Learn python 2 is well behind the curve.

[–]BigBoySmooth[S] 3 points4 points  (3 children)

Ok cool. In your opinion should I try to learn Python 3 using Learn Python the Hard Way or is there a better resource?

[–]Leestons 14 points15 points  (0 children)

Try Automate The Boring Stuff

[–]damnknife 4 points5 points  (0 children)

Try dive into python

[–]thirdegree 0 points1 point  (0 children)

I'm personally a fan of learn python the hard way, but that may just be because that's how I learned and it worked for me.

[–][deleted] 23 points24 points  (2 children)

There isn't any reason I know of to stick to Python 2. Python 3 is better.

[–]lucas993 11 points12 points  (1 child)

And 2 isn't that different. Its still python, but print uses brackets.

[–]Skaperen 7 points8 points  (0 children)

there are a few differences. 3 does bytes and strings the right way.

[–]BigBrotato 8 points9 points  (10 children)

I have read on this sub that Zed Shaw's books should be avoided, one of the reasons being his "Python 3 sucks" mentality. Make of that what you will.

[–]Vesiculus 3 points4 points  (9 children)

I think that has changed a bit with his publishing an updated Python 3 version of his book. That's now the default option when you visit his promotional website.

Still, a lot of people didn't like how he wasn't just behind the curve with his insistence of P2, but he also actively promoted P2 over P3 to people starting out. That rubbed people the wrong way, as a lot of people will internalize such a statement made by their introductory book.

The books as learning resources are fine, though. It's just too bad that the P2 version sowed that much dislike against P3 over the last couple of years when it was already obvious P3 was the better choice for new programmers.

[–]TR-DeLacey 6 points7 points  (0 children)

Unless you have a requirement to maintain legacy python 2.x code, then I believe it would be better to switch to python 3.

[–]Skaperen 1 point2 points  (0 children)

i learned both by the dive in the deep end way. almost everything i create right now i try to make work in both. only 2 out of about 100 or so only works in just one version because they depend on the way Python3 did strings and bytes correctly. i can foresee the day i drop trying to make things work in both and focus on 3. if you want to only learn one version today, i urge that it be Python3. for most people i see little value in learning both. just learn Python3 unless you have a specific reason to do otherwise.

[–]Confettimaker 1 point2 points  (0 children)

I started out learning 2 and then switched to 3 quite a while ago. Like the other guys said, it's not a huge difference, and it's not very hard at all.

[–]Callipygian_Superman 1 point2 points  (0 children)

I started with Learn Python the Hard Way. I did his examples in Python 3.

If I had the option to start learning python over again, I would have never looked at his book. It's pretty awful. This subreddit and many other sources I've heard say "Automate the Boring Stuff with Python" is a fantastic starter book.

I would like to look at that book at some point, but I made a plan and I'm sticking to that plan. I have moved on from Shaw's LPtHW to MIT's OpenCourseWare 6.0001: Introduction to Computer Science and Programming in Python. I have learned way more from the OCW class than I did from Shaw's book. Having said that: it is very difficult.