This repository is a comprehensive guide to Object-Oriented Programming (OOP) in Python, tailored for MLOps and general Python development. It covers fundamental to advanced concepts through practical examples and mini-projects.
The goal of this project is to demonstrate core OOP principles such as Class & Objects, Inheritance, Polymorphism, Encapsulation, and Abstraction. It includes standalone scripts for specific concepts as well as integrated applications like a Bank Management System and a generic "Chatbook" application.
A complete Bank Management System that integrates multiple OOP concepts into a single application.
- Concepts: Classes, Instance & Class Attributes, Private Attributes (Encapsulation), Getters/Setters, Static Methods, Class Methods, Inheritance (SavingAccount), and Polymorphism.
- Features: Create accounts, withdraw/deposit funds, check balances, and manage bank details.
A console-based social media application simulation called Chatbook.
- Features:
- User Login/Signup
- Forgot Password
- Write Posts
- Send Messages
- Concepts: Class design, menu-driven logic, state management (
is_logged_in).
A deep dive into Inheritance types with clear examples:
- Single Inheritance: Basic parent-child relationship.
- Multiple Inheritance: inheriting from multiple parents.
- Multilevel Inheritance: A chain of inheritance.
- Hierarchical Inheritance: Multiple children from one parent.
- Hybrid Inheritance: A combination of multiple types.
- Real-world Example:
Person->Studenthierarchy.
Demonstrates Encapsulation and data hiding.
- Bank Class: Shows how
__balance(private variable) is protected and how access attempts are handled. - ATM Machine: A practical use case of encapsulation with
withdrawanddepositmethods exposing controlled access to private data.
Illustrates Polymorphism (Method Overriding).
- Payment System: A base
paymentclass with subclassesCreditCardandDebitCard. - Logic: Both subclasses implement their own version of the
pay()method, demonstrating how the same method name can behave differently based on the object type.
Introduction to Classes and Objects.
- Basic class definitions for
employee,Car,student, andMobile. - Demonstrates constructors (
__init__), attributes, and methods showing object details.
A simple script demonstrating modularity by importing the Chatbook class from OOps_project.py.
A text file outlining the syllabus and topics covered in this repository.
You can run any of the scripts using Python. For example:
# Run the Bank Management System
python All_in_One.py
# Run the Chatbook Application
python OOps_project.py
# Run Inheritance Examples
python inheritance.py- Classes & Objects: Blueprints and instances.
- Encapsulation: Public vs. Private members, Getters & Setters.
- Inheritance: Code reusability through parent-child relationships.
- Polymorphism: Flexibility in method implementation.
- Abstraction: Hiding complex implementation details (implied through method interfaces).
- Static & Class Methods: Methods bound to the class rather than the instance.
Created for MLOps Python OOPs learning.