__repr__
The `__repr__` method in Python is a special function used to define a string representation of an object. Its primary purpose is to provide a clear and unambiguous representation that can help developers understand the object’s state. When you call `repr()` on an object or use it in an interactive session, Python invokes this method to return a string that ideally can be used to recreate the object.
This method is particularly useful for debugging and logging, as it allows developers to see the internal details of an object. By default, if `__repr__` is not defined, Python will return a generic string that includes the object's memory address. Customizing `__repr__` can enhance the readability and usability of your classes, making it easier to work with complex data structures like lists, dictionaries, or user-defined classes.