// resources
Resources
All
|
Cheatsheet
Code Example
Exercise
Template
Other
Achievement
|
Basics
Control Flow
Functions
Data Structures
Modules & Packages
Projects
Object-oriented programming
|
↑ oldest first
↓ newest first
// Code Example
oop_classes_objects.py
Classes and Objects — blueprint, constructor, self, methods. The foundation of OOP in one file.
// Code Example
oop_attributes_methods.py
Attributes and Methods — instance vs class attributes, default values, methods that read, modify, and return. Everythin…
// Code Example
oop_self.py
Understanding self — what it is, why it exists, how Python passes it automatically, and how it connects data and method…
// Code Example
oop_encapsulation.py
Encapsulation — private attributes, getters, setters, validation inside the object. The object enforces its own rules.
// Code Example
oop_inheritance.py
Inheritance — parent class, child class, super(), method overriding. Write shared logic once, inherit everywhere.
// Code Example
oop_polymorphism.py
Polymorphism — same method call, different behavior per class. One loop, no isinstance() checks, new classes without ch…
// Code Example
oop_special_methods.py
Special Methods — str, repr, len, eq, contains. Make your objects work with print(), len(), ==, and in.
// Exercise
calories_tracker_oop.py
Calories Tracker — OOP version. Same logic, new structure. CalorieTracker class with user parameter, independent files …
// Exercise
safe_paws_oop.py
Safe Paws — OOP version. Two classes: Animal and Shelter. Add, search, edit, adopt, activity report. Shelter("city_shel…
// Other
oop_mistakes.py
Common OOP Mistakes — 8 mistakes, 8 fixes. self, super(), mutable defaults, class vs instance attributes, single respon…
// Cheatsheet
OOP — The Full Picture
OOP — The Full Picture. Class and object, self, encapsulation, inheritance, polymorphism, special methods, common mista…
// Exercise
task_manager_r1.py
Task Manager — Round 1. Task and TaskList classes, add, load, display, persistence. Two classes, one system, ready to r…
// Exercise
task_manager.py
Task Manager — Round 2. Update status, filter by priority and status, delete with confirmation, export report grouped b…
// Achievement
oop_complete_medal.stl
You finished the OOP chapter. Download, print, and keep it. You earned it.