Magic Methods
Premium
You wrote __str__ in OOP I to control what print() shows. Python has a whole family of these dunder methods. They let your objects work with ==, +, and len().
You wrote __str__ in OOP I to control what print() shows. Python has a whole family of these dunder methods. They let your objects work with ==, +, and len().