Although STR (), repr () and ''operations are very similar in terms of features and functions, in fact repr () and'' do exactly the same thing, they return an object's "official" string representation. That is to say, in most cases, this object can be re-obtained through evaluate (using the built-in function eval (), but STR () it is different. STR () is used to generate a readable string representation of an object. Its returned results cannot be used for eval () evaluation, but are suitable for print statement output. Note that not all strings returned by repr () can use the eval () built-in function to obtain the original object.
That is to say, repr () outputs are friendly to Python, while STR () outputs are friendly to users. Even so, in many cases, the output of the three items is still the same.
If you are interested, you can writeCodeCompare STR, repr, and "".
Address: http://www.cnpythoner.com/post/251.html