Skip to content

codemetry-dev/learn-python-oop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 

Repository files navigation

🐍 Learn Python OOP

GitHub Repo Python License: MIT

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.


πŸ“Œ Why Learn OOP in Python?

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.

βœ… Target Audience

  • Beginners to intermediate Python learners
  • Learners familiar with basic procedural Python (variables, loops, functions)
  • Aspiring backend developers or software engineers

πŸ“š Course Modules

Module 1: Introduction to OOP

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

Module 2: Classes and Objects

  • Defining a class
  • Creating objects (instances)
  • __init__() constructor
  • Instance attributes vs class attributes
  • Practice Project: Create a Book and Library class

Module 3: Encapsulation

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

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

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

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)

Module 7: Magic Methods (Dunder Methods)

  • __str__, __repr__, __len__, __add__, etc.
  • Practice: Custom Vector or Point class with operator overloading

Module 8: Composition vs Inheritance

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

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)

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.


🎁 Teaching Tools & Resources

  • 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)

🧠 How to Use This Repo

  1. Clone or fork the repo:
    git clone https://github.com/codemetry-dev/learn-python-oop.git
    cd learn-python-oop

πŸ™Œ Stay Connected

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published