This method returns the string representation of the object. This method is called when print() or str() function is invoked on an object. This method must return the String object. If we don’t implement __str__() function for a class, then built-in object implementation is used that actually calls __repr__() function. Python __repr__() Python __repr__() function returns the object representation in string format. This method is called when repr() function is invoked on the object.