Skip to content

Latest commit

 

History

History

README.md

🧩 Learn OOPs in Python

Welcome to Learn OOPs, a simple and practical repository to understand and practice the core concepts of Object-Oriented Programming (OOP) using Python.
This project helps you learn by doing — with beginner-friendly code examples and exercises.


🎯 Purpose

The goal of this repository is to:

  • Understand the four pillars of OOP:
    🔹 Encapsulation
    🔹 Inheritance
    🔹 Polymorphism
    🔹 Abstraction
  • Write clean, modular, and reusable Python code.
  • Build a strong foundation for real-world software development and interview preparation.

🧱 Project Structure

learn-oops/ ├── oops/ │ └── class or objects/ │ ├── p0.py # Example of inheritance, encapsulation, ├── requirements.txt └── README.md


🚀 How to Run Locally

1️⃣ Clone the repository

git clone https://github.com/SuyXcode/learn-oops.git
cd learn-oops

###2️⃣ Create and activate a virtual environment

python -m venv .venv
# Activate it:
# On Windows:
.venv\\Scripts\\activate
# On Mac/Linux:
source .venv/bin/activate

###3️⃣ Install dependencies

pip install -r requirements.txt


🧩 Concepts Covered

Concept Example File Description
Encapsulation bank.py Using protected attributes (_balance) and property methods
Inheritance bank.py SavingsAccount and CheckingAccount inherit from BankAccount
Polymorphism bank.py, shapes.py Functions that handle different object types with the same interface
Abstraction shapes.py Abstract base class Shape defines a common blueprint
Composition (Upcoming) Combine objects for more complex relationships


🛠️ Tools & Technologies

  • 🐍 Python 3.11+
  • 🧪 PyTest for testing
  • 🧰 Git & GitHub for version control and collaboration
  • 🧑‍💻 VS Code (recommended for running and debugging)

📘 License

This repositories is open-source under the MIT License.
Feel free to fork, modify, and learn from it!


👨‍💻 Author

Suyash Singh
💡 "Turning Dream Event into Reality!"
📧 Email: suyxcode@gmail.com
🔗 GitHubMediumLinkedIn


🌱 Next Steps

✔ Add more real-world examples (Library Management, Student Class, E-commerce System).
✔ Implement interfaces, class methods, and static methods.
✔ Try OOP with Flask/Django to see how real frameworks use these concepts.
✔ Contribute your examples via pull requests!


If you find this repository helpful, give it a star on GitHub!