File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -152,11 +152,11 @@ Positional and keyword arguments can be arbitrarily combined::
152152``'!a' `` (apply :func: `ascii `), ``'!s' `` (apply :func: `str `) and ``'!r' ``
153153(apply :func: `repr `) can be used to convert the value before it is formatted::
154154
155- >>> import math
156- >>> print('The value of PI is approximately {}.'.format(math.pi ))
157- The value of PI is approximately 3.14159265359 .
158- >>> print('The value of PI is approximately {!r}.'.format(math.pi ))
159- The value of PI is approximately 3.141592653589793 .
155+ >>> contents = 'eels'
156+ >>> print('My hovercraft is full of {}.'.format(contents ))
157+ My hovercraft is full of eels .
158+ >>> print('My hovercraft is full of {!r}.'.format(contents ))
159+ My hovercraft is full of 'eels' .
160160
161161An optional ``':' `` and format specifier can follow the field name. This allows
162162greater control over how the value is formatted. The following example
You can’t perform that action at this time.
0 commit comments