magic methods | SoloLearn: Learn to code for FREE!


magic methods

How can I use magic methods

5/6/2020 6:27:02 AM


2 Answers

New Answer


Magic methods are not meant to be invoked directly by you, but the invocation happens internally from the class on a certain action. For example, when you add two numbers using the + operator, internally, the __add__() method will be called. Built-in classes in Python define many magic methods.


KUSHAGRA MISRA Use this 👇👇👇👇👇👇👇 Hope it helped