5 ms·
For a beginner who wants to learn Python, which one is better — 2 or 3?
by drops 10y ago
For a beginner who wants to learn Python, which one is better — 2 or 3?
- bnchrch 10y agoDefinately 3.
- satysin 10y ago3. When you need to work with a 2 code base the learning curve won't be big at all. Whereas if you start with 2 and then move to 3 you will have to unlearn a bunch of stuff which is just a waste of time. Start with 3 and then learn just the differences in 2 when/if you need them.
- cgriswald 10y agoAgreed. Just as a for-instance: In Python 2, the parenthesis on a print call are optional. In Python 3, they're not. Going from 3 to 2 you probably won't even notice. Going from 2 to 3... To this day I often fail to type those parenthesis.
- deleted 10y ago[deleted]
- pvg 10y agoDefinitely 3 and almost certainly not from this book.
- QML 10y agoIf you want to learn a language efficiently, work on a project with it. I went through Learn Python the Hard Way pretty fast but my retention wasn't that great.
- johansch 10y agoLearn Go instead.
- fnordfnordfnord 10y ago3, but when you find some snippet on the web that you want to try and it doesn't work, try not to forget that it may have been written in the Python 2 syntax.
- BuckRogers 10y agoLearn Go. It depends what you want to do with said skills but JS ES6 would be worth it too in the web space. I wouldn't recommend learning Python at this point with the 2/3 split and uncertainty. If you must learn Python I'd learn 2.7. Reasoning is that almost all the jobs are Python2 still. There's just so much code out there based on it and you're almost certainly going to have to use it anyway. Don't listen to the haters, it's what will pay your bills. Move to Python3 when/if your job does. They'll probably move to Go instead. For hobby work not remotely considering a job? Then learn Elixir.
- pvg 10y agoFor a beginner trying to decide between Python 2 and 3, 'learn Go' doesn't seem like useful advice. One good thing about Python is the gobs of educational material available, much of it free. If the person is looking to make this a career, they'll end up learning a bunch of languages as a matter of course anyway.
- BuckRogers 10y agoWith Python3 not likely to be one of them. I answered his question on 2 vs 3 if you read what I said.
- a3n 10y ago3. 2 is officially End of Life in 2020. http://legacy.python.org/dev/peps/pep-0373/ http://legacy.python.org/dev/peps/pep-0373/
- jwilk 10y agoDefine "better".