Classes

My latest experience in learning Python has centered around classes, which is a concept that is really at the heart of what makes Python an object-oriented programming language. It’s been challenging, and I’m just barely scratching the surface, but it has been a lot of fun so far. I can tell that this concept is core to defining whole categories of objects and the actions and behavior that your code will take towards those categories. Classes allow you to apply this logic towards objects more consistently, at least that’s the theory. Below is a super simple example I’ve taken from Eric Matthes’ Python Crash Course:

What this example is showing is that we’re able to make an attempt at modeling a dog, creating the behavior and actions around any dog (it could be millions of dogs, but we only will need to do this once), and then proving this logic by applying various methods to different dogs.