This repository demonstrates the implementation of Python Special (Magic/Dunder) Methods using Object-Oriented Programming concepts. Each method is explained with a simple example in a Jupyter Notebook.
- Constructor (
__init__()) - String Representation (
__str__()) - Developer Representation (
__repr__()) - Length (
__len__()) - Equality Comparison (
__eq__()) - Addition (
__add__()) - Subtraction (
__sub__()) - Multiplication (
__mul__()) - Item Access (
__getitem__()) - Item Assignment (
__setitem__()) - Membership Testing (
__contains__()) - Callable Objects (
__call__()) - Iteration (
__iter__()) - Next Item (
__next__()) - Boolean Evaluation (
__bool__()) - Destructor (
__del__())
Python-Special-Methods/
│
├── README.md
└── Special_Methods.ipynb
After completing this assignment, I learned how to:
- Use Python special methods.
- Overload operators.
- Make custom objects behave like built-in Python objects.
- Document code using Markdown in Jupyter Notebook.
- Publish projects using GitHub.
Course: EL162 Object Oriented Programming
Institution: University of Mines and Technology (UMaT)
HODO ERIC
This repository was created for academic purposes as part of an Object-Oriented Programming assignment.