From the course: Getting Started with Python Object Oriented Programming: A Hands-On Approach

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Getting started

Getting started

- [Instructor] Let's dive in and do some object-oriented programming with Python. Now, the basic idea of OOP is that we are trying to model real-world objects using code. For this example, we're going to be modeling playing cards from a standard deck. Now, I implore you, as we go through this video, anything you don't understand, just let it wash over you the first time, okay, because there's some quite tricky concepts involved. And if you get hung up on every little thing that you don't understand, then it's going to break the flow of your learning about the bigger picture, okay? So that's just a little word of warning there. So we're going to start with class Card. Now, a class basically is a template or a cookie-cutter or a blueprint. Now, these cards are going to have a value and a suit. So we're going to do this by having a function called def __init__, and f-string, which, in Python, are very, very useful formatting tools where we can basically interpolate or substitute…

Contents