TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Should I learn Python 3 or Python 2?

2 pointsby webbrahminabout 7 years ago
I plan to explore data science and machine learning. After looking into some MOOCs and other online learning resources I have come to the conclusion that a firm grasp of Python is essential. I am new to Python, so my question is should I learn Python 2 or Python 3?<p>Edit: Corrected a typo.

4 comments

__warlord__about 7 years ago
Python 3 for sure. Even if some major libraries are not yet supported is just a matter of time for them to be 3 compatible. And on top of that, you get a lot of goodies in python 3 specially around string manipulation and dictionaries. Take a look at this [0] post from the python community about python 3 vs 2.<p>0. <a href="https:&#x2F;&#x2F;wiki.python.org&#x2F;moin&#x2F;Python2orPython3" rel="nofollow">https:&#x2F;&#x2F;wiki.python.org&#x2F;moin&#x2F;Python2orPython3</a>
viraptorabout 7 years ago
Learn? 3, but really both - apart from string encoding, there are almost only small syntax differences. Nothing that would make you go &quot;I don&#x27;t know what it does, I don&#x27;t know python 2&quot;.<p>Use? 3 if possible, unless some super important library is not updated. 2 is going away at some point. Let it die.
brudgersabout 7 years ago
There aren&#x27;t any differences important enough to worry about at the &quot;I am learning Python&quot; level. Down the road, problems between one and the other will get resolved by Googling into StackOverflow, blogs, and the Python documentation. Googling to resolve problems is part of learning Python...and every other programming language these days. Hence Googling for answers is part of learning to program.<p>Good luck.
kgravesabout 7 years ago
3. All the libraries we all know and love are moving there, even Guido the Python BDFL killed 2.7 off himself[0] with a definitive EOL date of 01&#x2F;01&#x2F;2020. Learn 3.<p>[0] <a href="https:&#x2F;&#x2F;mail.python.org&#x2F;pipermail&#x2F;python-dev&#x2F;2018-March&#x2F;152348.html" rel="nofollow">https:&#x2F;&#x2F;mail.python.org&#x2F;pipermail&#x2F;python-dev&#x2F;2018-March&#x2F;1523...</a>