How do I change the string representation of a Python class?

In Java, I can override the toString() method of my class. Then Java’s print function prints the string representation of the object defined by its toString(). Is there a Python equivalent to Java’s toString()? For example, I have a PlayCard class. I have an instance c of PlayCard. Now: >>> print(c) <__main__.Card object at 0x01FD5D30> … Read more