A beginner-friendly, project-based course for mastering Object-Oriented Programming (OOP) in Python. This repo contains course outlines, example code, practice exercises, and real-world mini-projects. Ideal for backend developers, aspiring engineers, and self-taught learners.
Object-Oriented Programming is a powerful paradigm that makes your code:
- Easier to maintain
- More reusable and modular
- Suitable for large-scale projects
This course takes you from zero to hero with practical, well-structured OOP examples.
- Beginners to intermediate Python learners
- Learners familiar with basic procedural Python (variables, loops, functions)
- Aspiring backend developers or software engineers
Module 1: Introduction to OOP
- What is Object-Oriented Programming?
- Benefits of OOP in software development
- Procedural vs OOP programming in Python
Module 2: Classes and Objects
- Defining a class
- Creating objects (instances)
__init__()
constructor- Instance attributes vs class attributes
- Practice Project: Create a
Book
andLibrary
class
Module 3: Encapsulation
- Public, private, and protected members
- Getter and setter methods
- Use of
@property
decorator - Practice: Banking System with encapsulated account details
Module 4: Inheritance
- What is inheritance?
- Base class and derived class
super()
and method overriding- Multiple inheritance (briefly explained)
- Practice: Employee Management System with different types of employees
Module 5: Polymorphism
- Method overloading (via default arguments)
- Method overriding
- Duck typing and dynamic typing in Python
- Practice: Shape area calculators (
Rectangle
,Circle
, etc.)
Module 6: Abstraction
- Introduction to abstraction
- Using
abc
module and@abstractmethod
- Interface vs abstract class in Python
- Practice: Payment system with different payment methods
Module 7: Magic Methods (Dunder Methods)
__str__
,__repr__
,__len__
,__add__
, etc.- Practice: Custom
Vector
orPoint
class with operator overloading
Module 8: Composition vs Inheritance
- When to prefer composition
- Design principle: "Has-a" vs "Is-a" relationship
- Practice: Car and Engine example using composition
Module 9: Real-world Project
Project Ideas:
- Student Management System
- E-commerce Product Model
- Inventory System
Implement full OOP design:
- Encapsulation
- Abstraction
- Inheritance
- Polymorphism
- Clean code structure
Module 10: Bonus Topics (Optional for Advanced Learners)
- SOLID Principles in Python
- UML basics for class design
- Test-Driven OOP Design (
unittest
) - Intro to design patterns (e.g., Singleton, Factory)
All code examples are available in their respective folders with comments and test cases.
- Jupyter Notebook or Replit for live coding
- Diagrams: Class relationships (draw.io, mermaid)
- Weekly quizzes & mini-projects
- Final GitHub project submission
- Certificate of completion (optional)
- Clone or fork the repo:
git clone https://github.com/codemetry-dev/learn-python-oop.git cd learn-python-oop
If this repository helped you, please consider:
β Starring the repo to support the project
π£ Sharing it with fellow learners
π§ Follow us below for more educational content Weβre building a free learning platform for coding and software development