< !-- Digital window verification 001 -->

What Should I Learn as a Beginner: Python 2 or Python 3?

| Get awesome (and free) stuff here

What's the difference between Python 2 and Python 3? Or more specifically Python 2.7 and 3.3. (Since those appear to be the main versions in debate.)

Instead of trying to answer this questions myself (a newbie in the world of Python), I decided to turn to the experts…AKA the internet. So, let the great debate begin! Sarcasm…it's not too much of a fiery debate.

(Also—there is an update at the bottom of this article, written in more recent times.)

Want to master Python?

Then download my list of favorite Python learning resources.

Don't worry. I'll never, ever spam you! Powered by ConvertKit

Python 2 vs. Python 3: Overall Picture

Wiki.python.org goes into depth on the differences between Python 2.7 and 3.3, saying that there are benefits to each. It really depends on what your are trying to achieve. But, in summation: “Python 2.x is legacy, Python 3.x is the present and future of the language.”

There are subtle differences between the two. But the biggest difference is the print statement.

What's Different About The Print Statement

Taken from a discussion on Stack Overflow,

“The most visible (difference) is probably the way the “print” statement works. It's different enough that the same script won't be able to run on both versions at the same time, but pick one and you'll be fine.”

A similar view from the Twitterverse:

Essentially, the print statement has been replaced with a print () function

Important: Python 2 Has Libraries

So beyond this difference in the print statement, across the web I see lots of mention to the library support in 2.7: 

More on the Twitterspace, I Tweeted: 


This article on Medium, mentioned in the Tweet above and titled “Python 3 is killing Python”, has a lot of information that goes over my head as a beginner. But it's clear this writer, Stephen A. Goss, is very passionate about not moving to Python 3 and keeping Python 2 alive. He also points to 3rd party libraries as one of Python 2's greatest strengths.

Why Some Say Python 3.3 Is Better

In this talk (here's a video) Brett Cannon, who works for Python, is all about Python 3.3. He admits off the bat he has an obvious bias. But still has enough to say to fill up a forty minute talk.

Beyond the guy's opinion who works for Python, across the internet I was stumbling upon similar sentiments that I think are expressed well from a discussion I found on Quora:

“The main advantage of 3.x is that it is on the cutting edge, so all the new features will be implemented in there rather than being added to 2.x. The other thing you may want to consider is that it is the common python of the future, so looking a couple of years down the line, this will be the mature branch that people go to.”

Basically, it seems Python 3 is where the future is heading. But Python 2 has far more documentation available.

As A Beginner, Which Should I Learn?

I'm sure if you're a beginner, like me,  you're thinking: “Umm cool. But which should I learn?” Because when you're new to programming, you're still trying to wrap your head around a function. Not deeply analyze the subtleties between versions of the same language.

Found in the same Stack Overflow discussion mentioned earlier, (however, this time from a different commenter):

“Python 3 is a nicer and more consistent language, BUT, there is very limited third-party module support for it. This is likely to be true for at least a couple of years more. So, all major frameworks still run on Python 2, and will continue to do so for a significant time. Therefore, if you learn Python today, you should learn Python 2, because that is the version you are going to end up actually using.”

At the same time, one could certainly start off learning Python 3.3. It is where the language is heading, anyways.

However, I do believe it is wise to start off with 2.7 as a beginner for the main reason that there is far more documentation to help you along the way. Plus computers (well, at least my Mac OS X) come with Python 2.7 built in already. So you don't have to go out and download 3.3.

Conclusion: Python 2 is the Winner…for now

For now I will continue learning with 2.7. It seems like the differences between 2x and 3x are relatively minor. My main goal is to just learn a programming language — I don't want to get caught up in the minor variations between the two versions.

Besides, it seems like both are acceptable.

Want to master Python?

Then download my list of favorite Python learning resources.

Don't worry. I'll never, ever spam you! Powered by ConvertKit

UPDATEJanuary 29, 2015:

As of January 6, 2015:

The StackOverflow discussion posted above has been updated to reflect that one SHOULD start with Python 3 if they are learning today, in 2015.

Nonetheless, do your research. Make your own conclusions about which would be better for you to learn — depending on what you want to do with the language.

But if I were to start today learning Python, I'd start with Python 3. 

  • Pingback: 13 Places Where Women and Girls Can Learn to Code()

  • Marcos Accioly

    Great post. You should consider adding a date and time to your post, though. Hard for a reader to know if this is a dated analysis. =)

    • Hi Marcos — Thanks for reading. And, yes, I know!

      I am currently planning a website redesign (more like a freshening up) and I intend on adding the dates back into the single posts.

      For your reference, though, this post was published on June 6, 2014.

      The site has only been around since late April of 2014. So all posts have been published since then :)

      But, yes, looking into the future, it would be very helpful for people to know exactly how recent the information is.

  • HSuke

    How is the giant picture of a girl in a tunnel relevant to this topic? So random.

    • Yes – you are very correct. It is random!

      When I soon redo my site, I will most likely nix images with articles altogether or make them much less prominent. Maybe I will even spend some time going back & editing the ones that are irrelevant.

      Either away, I wrote this article back in June. I’ve learned a lot since :-) (including not using images like this one!)

  • puffy

    Sry but this is a bit annoying. The stackoverflow answer you cited is from Jul. 14. 2009, and even the original answer was updated to show the answer was outdated.

    • It was outdated and then updated. However, I see it updated on January 6th 2015. (the stackoverflow comment)

      I wrote this article in May 2014, before that was added.

    • robmuh

      Stack Overflow regularly contains bad conclusions and mob violence. ;) Very frequently it is out of step and polluted with first-commenters more concerned with ratings than information. I suggest you include a Twitter search of respected professionals new and experienced, research them personally and then ask politely for their opinions on such things. At least include this in your considerations. Basing your decisions on Stack Overflow is as bad as collectively reading all the Tech blogs for a handle on what is real in the Tech sector. Hyperbole abounds. I have found the best advice and opinions often comes from the professionals I have been fortunate to meet that don’t waste their time on social media much at all.

  • Pingback: Review of Udacity's Programming with Python Course()

  • CoolVader

    If your project depends on 3rd party software or libaries like OpenStack cloud platform, scapy, gevent etc. then 2.7 is your ONLY choice. These things are unlikely to be ported to 3.x for another decade.

    • They thanks — good to know.

    • robmuh

      If your project depends on 3rd party software with such dependencies you have a bigger problem then selecting Python 3. ;)

  • Brad Atherton

    Thank you. So many comparison articles end up without a solid conclusion in the end. I appreciate the information put forth in this article and it cements that as a beginner I should use Python 2.7. As a beginner it is easy to get sidetracked and not know which way to go. Your article has helped provide direction.

    • Thanks! I hope you caught the update at the bottom —

      “UPDATE: January 29, 2015:

      As of January 6, 2015:

      The StackOverflow discussion posted above has been updated to reflect that one SHOULD start with Python 3 if they are learning today, in 2015.

      Nonetheless, do your research. Make your own conclusions about which would be better for you to learn — depending on what you want to do with the language.”

      The time I wrote this, 2.7 was the way to go. Apparently 3 is where one should start now.

      Anyway – don’t get too caught up in deciding :)

      • Brad Atherton

        Actually I did miss that update. But, everything I have read tells me to stay with 2.7. Since I am new I have to start somewhere and all of the fun things I see are written for version 2.

        • Got it. I haven’t done Python in awhile…but it sounds like you know what you’re doing :)

          Good luck learning!

  • robmuh

    If the main basis of the authors conclusion to learn 2.7 is based on availability on Mac (which I think carries more weight with the author than is presented) and preponderance of documentation then on both counts this argument fails for anyone learning today, as the Stack Exchange list concludes and as the Python leadership suggest. This is especially true for anything using `input()` or print(“something”, end=”) which are very useful for beginners. I strongly recommend against Python 2 for beginners and teach nothing but Python 3 from a Linux command line at our school. (IDLE is a waste of time and used very rarely in any applied Python situation.)

    • I just want to add again that I wrote this article over a year ago and it was something I was wondering about while teaching myself Python. And am aware that now (in mid 2015) Python 3 is the recommended way!

  • David Murphy

    If you are considering it for your own projects then check out what you are trying to do, and what 3rd party modules you would want to use. if most / all what you need is in 3, then go 3. If its not then go 2.

    If you are looking to go into professional programming a s a Python developer then again you need to check out what the commercial world is using. A lot of Python development professionally is around the area of data science and scientific programming and also in financial services. These all make heavy use of packages like Numpy Scipy, Pandas and other related numerical packages. I believe most of these packages are now available in 3, but look at the job ads and see what the industry is using.

  • ProDigit

    I’m just starting out, and found it indeed strange that some commands on online python emulators wouldn’t work in my latest Python 3.5 version of Idle.
    I continue to learn 2.7, until there is more data online about 3.5.

    I don’t think I’ll be using libraries anytime soon.

    • I see – thanks for sharing! Haven’t used Python in awhile but there still seems to be some debate over 2.7 versus 3.5! As long as it works for you :)

  • malbuy

    OMG. The advice of this article is ill-fated. (the writing is good, and author seems like a nice person from her tone)

    I suspect maybe the author is one of those who started few years earlier and thus would dyingly protect the existence of 2.7 until their last breath.

    Some people started with Python when it’s 2.x or even 1.x. So they’re more comfortable with 2.x coding syntax.

    They might learn the slight difference of 3.x coding syntax, but they won’t port all their current codes to 3.x, when – there don’t have to. (that’s a bad thing in open source community – too much freedom and opinions. As people made enough noises, support will be extended. Sometimes Micro$oft did a better job on market trend and technology growth)

    If people could be given a new choice to start over today, most will choose 3.x over 2.7 (unless some odd antique-minded guys who have things with old stuff)

    5 years… ok, 10 years from now, how many will still be using 2.7?
    Today is 2016, 10 years back there wasn’t even an iPhone. 5 or 10 years is a “long” time in technology timeline.

    Remember, Python is relatively a young programming. (yes we all heard it was born in 94, but trust me nobody took it seriously until after 2000), it’s still trying to adapt with the best terminology with past failure experiences.

    If the architecture of 2.x was so perfect, will the core team behind Python so ignorant to redesign a new 3.x model with no new features and no backward support? Unless they have a secret plan to kill Python in the soonest time.

    Libraries support of 2.x is great, but it’s in “defending” stage not “progressing” stage, the support of 2.x libraries certainly won’t last forever.

    so why ask our kids to start with a soon-to-obsolete stuff?

    And compare to the learning curve (python is still easy to learn but not easy to master), the difference of 2.x and 3.x is so minor that one wouldn’t bother at all.

    I’ll say, by all means, start with 3.x. Never start with 2.7.

    • Just so you know at the end I did add this update in the article:

      ” UPDATE: January 29, 2015:

      As of January 6, 2015:

      The StackOverflow discussion posted above has been updated to reflect that one SHOULD start with Python 3 if they are learning today, in 2015.

      Nonetheless, do your research. Make your own conclusions about which would be better for you to learn — depending on what you want to do with the language.”

      Hopefully I can make more updates to this post soon :)

      Thanks though for sharing your thoughts on the matter. (I agree – starting with 3 now is a good decision!)

      • malbuy

        Yes I just noticed. Sorry my last comment didn’t catch that.

        I edited my whole comment and left with only an opinionated statement. :)

        Python is a beautiful programming. Thanks for sharing the article.

    • Riley L.

      I switched over from python 3.x to python 2.7.
      Can I please see why I should head back to python 3?

      • malbuy

        The context here is for “learning”, not “using”.

        If you’re “switching” from 3.x to 2.7 for a reason (maybe because of some existing codes not ported to 3.x yet), perhaps should stick with your decision because you’ll need to use 2.7 and maintain it.

        Else, new learners are advised to start with 3.x, it’s faster and with more support in the future.

  • Nehemiah Jacob

    Its 2016 and my brand new shopping cart project is in, Yes Python 2.7 and Django 1.8. Thumbs up.

  • 2016 and NO reason to switch to a language where the most basic variable type is based on funny enumerated symbols. On the meaning of which humans and computers disagree.
    *This* is the core problem thats why libs can’t be ported, and why professional I/O intense code bases should not be ported. Seriously, ditching the bytestring and trying to decode everything into unicode was … simply crazy.
    Is this the world you want to be thrown into: http://tinyurl.com/gnj9p7w ?

    Then stuff like this:

    while true; do python3.5 -c “import time; print(tuple(time.strptime(‘nov 1.1.1900’, ‘%b %m.%d.%Y’)))”; done

    which make me think, WTF!?!?!

    Long live Python2.7
    They can officially bury it as often as they want, there is industrial use, there are large code bases, there is project code out there and there is this core design problem which makes a migration anyway undesirable and will cause the wildest errors in production.

    • addendum, regarding the strptime: yes I know, its because of the pseudo random salt for hash() which became default in py3. But still it demonstrates the risks you run into: changed defaults but stdlib still not fully fixed to cope with those changes – and thats a risk. The main argument remains, though, and that is the base type. The unicode sandwich idea is broken when you do I/O and don’t care about the interpretations of the data by humans, which is the case in a guessed 99% of all problems, the word ‘unicode’ does not appear in the OSI model, except for *one* example on layer 6. Basing a whole programming language on this example encoding deprives it from useability for problems on all the other layers.

  • Shashank

    I am Beginners for Python. I totally confused after reading this post and some comments. So now Days Which version should I use?

  • john smith

    Python is a beautiful programming. Thanks for sharing the article. I totally confused after reading this post and some comments. So now Days Which version should I use?
    Python Programmer

  • jeremejazz

    In my opinion the relationship between Python 2.x and 3.x is similar to C and C++. Both have the same syntax in most parts but the latest has a lot of changes. But eventually despite C++ is more advanced, people still use C especially for legacy code.

    The same goes to Python 2.x, we use it for a lot of libraries. For me I am learning Python 2.x as first then eventually go for 3.x. I think this encouragement to use 3.x is just to push the community which is hard. I don’t see anything wrong when learning any of the 2 as the important is to know the python syntax itself. My reason for learning 2.x first is just to get started immediately on a job as a lot of companies still use it but if I were to make new personal projects, I’d write them in 3.x.

    But in the end it’s all trivial. I believe people will still need to learn Python 2.x even after it ends support in 2020, just like most legacy programming languages.

    By the way the link for stackoverflow discussion is broken

  • Tickle The Boxes

    As a newbie to programming with a very basic understanding of basic, dos, html and jcl (from a job 30 years ago as a mf op), I had this exact question, python 2 or 3. How do the arguments either way in this article stack up in 2017?

    • Hey! Most people agree that Python 3 is the way to go in 2017. Good luck as you keep learning!

      • Tickle The Boxes

        Thanks and thanks for taking the time to reply!

  • what about now

  • Thanks..it helped

  • rtao

    This article is very misleading. The title “Python 2 has Libraries” is suggests that there are no modules (library generally refers to only the standard library) in Python 3, though many popular and often used modules have been ported to the new version. Tools such as 2to3 make it simpler to update code.
    The greatest error, in my humble opinion, is where you state that the biggest difference is the print statement syntax change. I think that though print statements are often used, this is one of the smallest differences since it is only a syntactical difference, while other changes affect the actual functionality of Python.
    I like the idea of writing articles on learning Python from a learner’s point of view, but please make sure you are not sacrificing accuracy by doing so.

  • Arie May Wibowo

    So, for 2017 absolutely to learn Python 3?