Skip to main content

4 docs tagged with "classes"

View all tags

A Simple OOP Project: Modeling a Real-World Entity

Theory is important, but the best way to solidify your understanding of Object-Oriented Programming is to build something. In this article, we will put together all the concepts we've learned in this series—classes, objects, attributes, methods, and encapsulation—to model a real-world entity from scratch.

Core OOP Concepts: Classes and Objects

Welcome to a new chapter in your Python journey! So far, we've been using a style of programming called procedural programming. We write procedures (functions) that perform operations on data. This is great, but as programs become larger and more complex, it can be hard to manage the relationship between the data and the functions that operate on it.

Defining Classes: Attributes and Methods

In the last article, we learned that a class is a blueprint and an object is the instance we create from it. We used the init() method to set up the initial data, or attributes, of an object.