Python3 vs. Python2

Colt Steele
A free video tutorial from Colt Steele
Developer and Bootcamp Instructor
4.7 instructor rating • 11 courses • 1,038,276 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:16 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 two versus Python three, 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 enhanced. They're always changed. New features are added in. It's constantly a process of growing. So back in 2008, the creator of Python, his 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 released Python three. So this was 10 plus years ago in 2008. And at the time, the goal was to be for Python three, 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, just 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 three 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 all JavaScript 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 three, 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 three. And because of that, still to this day, Python two point X is still commonly used. Python three 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 three, 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 two to three 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 three. 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 three came out, it was one big happy family. All these developers, everybody in the Python community was writing Python two point X, and they say hi to each other. They send Haaz back and forth. It's real happy. But then Python three came out, which was an attempt to make Python great again. And there is very mixed reactions as signified by all of these emoji 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 two or why you have to learn Python three 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 two 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 three 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 three and then go back if you need to work in Python two. 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 two. So if you upgraded to Python three, you're in this Frontierland where you couldn't rely on common packages that you were used to. But that's no longer the case at all. There's a website here. I'll include the link called Python three Readiness, and it shows out of the three hundred and sixty 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 three now out of the top 360. What? There's twelve that aren't and you can see them here highlighted in white, but everything else is supporting Python three. 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 two, 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 three. So that's not a that's not a problem. Not a question anymore, but the most compelling reason, honestly, is that Python three is the future. There's also the fact that Python two is going to be retired officially. So Python two point seven is still being maintained now. But in just a couple 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 three is designed to be the version that lives on. So everybody who's learning Python two right now is going to have to move over to Python three. 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 website that goes into the key differences between two point seven point and three point X. 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 three, 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 three. You have to add the Perens. So it's a minor difference. But you can see if if you wrote code in Python two and you didn't have those prints and you tried to run it in Python three, 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 is pretty clear cut to learn Python three at this point, all the blog post criticisms that you can 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 three is the future. So it's unlike, you know, I'm trying to sell it to you or something, but it just is that that's not even my choice. The developers of Python have made it clear that Python three is where things are going, so why not learn Python three? And finally, one more picture. My cat has a long video like that old grumpy face.