
This will be a short article about Python dunder methods, also known as magic methods.
What are Dunder Methods?
Dunder methods are special methods in Python that start and end with double underscores (__). They allow you to define the behavior of your objects for built-in operations, such as addition, subtraction, string representation, and more.
Some common dunder methods include:
__init__(self, ...): Called when an object is created.- Like our
%OnNewmethod in ObjectScript.
- Like our
__str__(self): Called by thestr()built-in function andprintto represent the object as a string.__repr__(self):
(1).jpg)
.png)



