Skip to content

ericinfocus07/Python-Special-Methods

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

Python Special Methods

Overview

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.


Topics Covered

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

Repository Structure

Python-Special-Methods/
│
├── README.md
└── Special_Methods.ipynb

What I Learned

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 Information

Course: EL162 Object Oriented Programming

Institution: University of Mines and Technology (UMaT)


Author

HODO ERIC


License

This repository was created for academic purposes as part of an Object-Oriented Programming assignment.

About

EL162 OOP Assignment - Python Special Methods

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors