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