summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2016-02-22 13:53:03 (GMT)
committerGeorg Brandl <georg@python.org>2016-02-22 13:53:03 (GMT)
commit2d43bc2fc26ff50b4aa273d313c7decc80590cc7 (patch)
tree8fe45a9ee34ded49100ac637c3f8f636ead06d73 /Doc
parent72f2ef41376610cd2cb545672b23c48d72ec63c7 (diff)
parentf1d371bde9be7bf9dab21114b8137c66476a20ac (diff)
downloadcpython-2d43bc2fc26ff50b4aa273d313c7decc80590cc7.zip
cpython-2d43bc2fc26ff50b4aa273d313c7decc80590cc7.tar.gz
cpython-2d43bc2fc26ff50b4aa273d313c7decc80590cc7.tar.bz2
merge with 3.5
Diffstat (limited to 'Doc')
-rw-r--r--Doc/tutorial/inputoutput.rst10
1 files changed, 5 insertions, 5 deletions
diff --git a/Doc/tutorial/inputoutput.rst b/Doc/tutorial/inputoutput.rst
index f2171f4..686b2b1 100644
--- a/Doc/tutorial/inputoutput.rst
+++ b/Doc/tutorial/inputoutput.rst
@@ -153,11 +153,11 @@ Positional and keyword arguments can be arbitrarily combined::
``'!a'`` (apply :func:`ascii`), ``'!s'`` (apply :func:`str`) and ``'!r'``
(apply :func:`repr`) can be used to convert the value before it is formatted::
- >>> import math
- >>> print('The value of PI is approximately {}.'.format(math.pi))
- The value of PI is approximately 3.14159265359.
- >>> print('The value of PI is approximately {!r}.'.format(math.pi))
- The value of PI is approximately 3.141592653589793.
+ >>> contents = 'eels'
+ >>> print('My hovercraft is full of {}.'.format(contents))
+ My hovercraft is full of eels.
+ >>> print('My hovercraft is full of {!r}.'.format(contents))
+ My hovercraft is full of 'eels'.
An optional ``':'`` and format specifier can follow the field name. This allows
greater control over how the value is formatted. The following example