Next / Previous / Contents / TCC Help System / NM Tech homepage

9.4.3. The conversion part

Following the name part of a format code, you can use one of these two forms to force the value to be converted by a standard function:

!sstr()
!rrepr()

Here's an example:

>>> "{}".format('Don\'t')
"Don't"
>>> "{!r}".format('Don\'t')
'"Don\'t"'