Python3 vs. Python2

Colt Steele
A free video tutorial from Colt Steele
Developer and Bootcamp Instructor
4.7 instructor rating • 10 courses • 977,247 students

Learn more from the full course

The Modern Python 3 Bootcamp

A Unique Interactive Python Experience With Nearly 200 Exercises and Quizzes

29:43:09 of on-demand video • Updated December 2020

  • Learn all the coding fundamentals in Python!
  • Work through nearly 200 exercises and quizzes!
  • Learn about all of the latest features in Python 3.6
  • Use Python to create an automated web crawler and scraper
  • Make complex HTTP requests to APIs using Python
  • Master the quirks of Python style and conventions
  • Really Really Understand Object Oriented programming in Python
  • Learn testing and TDD (Test Driven Development) with Python
  • Write your own Decorators and higher order functions
  • Write your own Generators and other Iterators
  • Confidently work with Lambdas!
  • Master tricky topics like Multiple Inheritance and Polymorphism
  • Build games with Python
  • Build larger projects that span across multiple files
  • Work with all the Python data structures: lists, dictionaries, sets, tuples, and more!
  • Become an expert at list and dictionary comprehensions
  • Master built-in python functions like zip and filter
  • Handle errors and debug code
  • Write your own custom modules
  • Work with files, including CSV
English [Auto] All right welcome back. Let's quickly chat about Python 2 versus Python 3. So if you're like me you're probably used to your software updating and changing all the time whether it's your phone's operating system your gaming console that happens to upgrade and restart. Right when you download a new game or your computer your Windows or Mac operating system these things change all the time there's always new versions and programming languages are really no different. They're always enhance they're always changed. New features are added in. It's constantly a process of growing. So back in 2008 the creator of Python. Its name is Guido van Rossum was a bit unhappy with some of the really important architectural decisions that were made early on in Python and he wanted to change them so he decided to overhaul Python and release Python 3. So this was ten plus years ago in 2008 and at the time the goal was to be for Python 3 to be the present and future of the language. People were supposed to adopt it pretty quickly and stick with it. But as you can probably tell by the fact that I have to make this video it was more complicated than that. And the reason for all the trouble all the controversy is that Python 3 is not backwards compatible. So usually when you have a programming language and changes are made it's made incrementally and it's made in a way that old code can still run. So old javascript's written five years ago if you tried to run it now there won't be any problems. It won't be using some of the new features. It might not look as nice but it will still work. But with Python 3 the opposite was true. So the all the existing users the existing companies that were built on Python to their code their libraries everything that they had done up until that point would not work if they were run with Python 3. And because of that still to this day Python 2.0 X is still commonly used Python 3 is now very very common. But that wasn't always the case because it's taken a while for companies and for libraries to fully support Python 3 because it had to be. It was a decision. Oftentimes with other updates you just kind of opt into it without thinking. But going from Python 2 to 3 is a very deliberate choice you have to make if you're on a team at a company that team had to decide to migrate to Python 3. So it took a while. It's over 10 years later and it's still not fully solved. So this is a little diagram. Back before Python 3 came out it was one big happy family. All these developers everybody in the pipeline community was writing Python to point X and they say hi to each other they send hearts back and forth. Real happy. But then Python 3 came out which was an attempt to make Python great again and there was very mixed reactions as signified by all of these and Moji here. It was very very polarizing. What ended up happening is that the community was split. We have this box with a line through the middle and now our happy family has been torn apart. And if you're someone who's trying to learn Python for a while it's been a little confusing about where you should start. There are thousands and thousands of blog posts and articles and YouTube videos where people explain the difference and talk about why you have to learn Python too or why you have to learn Python 3 or how to decide if you're new. It goes on and on and on. And for a while there really was a lot of ambiguity around it. Python 2 was definitely the best choice early on. But things have changed it's just been really slowly very incrementally. But almost 10 years later Python 3 is absolutely the way to go. The situation has improved a ton. So what makes me say that well first of all it's just easier in general to learn the most up to date current standards to learn Python 3 and then go back if you need to work in Python to for some reason. You can figure out the key differences in the quirks rather than going the other way. But more importantly most of the main criticisms of things people didn't like just don't matter anymore. It used to be that all the popular packages all the tools that people would use the utilities that were written for Python were only written in Python too. So if you upgraded to Python 3 you were in this frontier land where you couldn't rely on common packages say you were used to. That's no longer the case at all. There's a Web site here. I'll include the link called Python 3 readiness and it shows out of the 360 most popular Python packages that are used all the common all the important things that you would ever need to do. Well not everything but most of the things you'd ever need to do. They are all supporting Python 3 now out of the top 360 what there's 12 that aren't and you can see them here highlighted in white but everything else is supporting Python 3. But this wasn't the case just a couple of years ago. It was a much different picture. So many of the older courses still encourage you to learn Python too because at the time that's what everyone was doing. But like I said the situation has changed all the popular packages you'd ever need support Python 3 so that's not a that's not a problem. It's not a question anymore. But the most compelling reason honestly is that Python 3 is the future. There's also the fact that Python too is going to be retired officially. So Python 2.7 is still being maintained now. But in just a couple of short years in 2020 at some point there's not an official date there's going to be a time where it's not maintained. So there's not going to be these two versions going forever. Python 3 is designed to be the version that lives on. So everybody who's learning Python to right now is going to have to move over to Python 3 If you're curious and you want to dive into the differences. It might be easier once you've learned some Python but there's this Web site that goes into the key differences between 2.7 for next and three point six. So one just really quick example I'll show you one of the first things we'll learn in this course is called the print function. And in Python 3 it looks like this print and then parentheses and we pass in something to print in Python to print was a statement rather than a function. So you didn't add parentheses. You could do it like this print space Hello world. In Python 3 you have to add the parents. So it's a minor difference but you can see if you wrote code in Python too and you didn't have those Prendes and you tried to run it in Python 3 it wouldn't work because that's no longer valid code. So if you are a complete beginner and you are deciding I think the case is pretty clear cut to learn Python 3 at this point all the blog post criticisms that you could still find out there most of them are old and they're out of date because the situation has changed. And just remember that Python 3 is the future. So some like you know I'm trying to sell it to you or something but it just is. That's not even my choice. The developers of Python have made it clear that Python 3 is where things are going. So why not vote in Python 3. And finally one more picture my cat has a long video like that old grumpy face.