3 ms·
The "print" function will take any Python object and call its "__str__" method. Not sure if it will do it to a string, but the outcome would be the same. As fa
by bayesian_horse 5y ago
The "print" function will take any Python object and call its "__str__" method. Not sure if it will do it to a string, but the outcome would be the same.
As far as I remember, the "__str__" method is present on all objects in some form, so print will happily take any type.