The STR () function is meant to return representations of values which are fairly
Human-readable, while repr () is meant to generate representations which can be read
The interpreter (or will force a syntaxerror if there is not equivalent syntax).
Objects which don't have a participant representation for human consumption, STR () will
Return the same value as repr (). incluvalues, such as numbers or structures like lists
And dictionaries, have the same representation using either function. Strings and
Floating point numbers, in particle, have two distinct representations.
>>> try: <br/> raise exception (1, 2, 3); <br/> Except t exception as E: <br/> Print (E ); <br/> Print (Repr (e); <br/> Print (STR (e); <br/> Print (E. ARGs); </P> <p> (1, 2, 3) <br/> exception (1, 2, 3) <br/> (1, 2, 3) <br/> (1, 2, 3) <br/> S = 'Hello world' <br/> STR (s) <br/> 'Hello world' <br/> repr (s) <br/> "'Hello world'"