__str__ vs __repr__ In Python
Summary: The key goal of __str__ and __repr__ is to return a string representation of a Python object. The way they represent the string object differentiates them. str()Ā &Ā __str()__Ā return aĀ printable/readable string representation of an object which is focused on the end-user. repr()Ā &Ā __repr()__Ā return a string representation of an object that is aĀ valid Python object, something you can … Read more