Mercurial > cpython-lru_cache-weakref
diff Doc/tutorial/inputoutput.rst @ 43219:655071bf6c45
Convert all print statements in the docs.
| author | Georg Brandl <georg@python.org> |
|---|---|
| date | Tue, 04 Sep 2007 07:15:32 +0000 |
| parents | 4902671dd678 |
| children | 0c8fec76111c |
line wrap: on
line diff
--- a/Doc/tutorial/inputoutput.rst Tue Sep 04 07:07:56 2007 +0000 +++ b/Doc/tutorial/inputoutput.rst Tue Sep 04 07:15:32 2007 +0000 @@ -132,7 +132,7 @@ Using the ``%`` operator looks like this:: >>> import math - >>> print 'The value of PI is approximately %5.3f.' % math.pi + >>> print('The value of PI is approximately %5.3f.' % math.pi) The value of PI is approximately 3.142. If there is more than one format in the string, you need to pass a tuple as @@ -140,7 +140,7 @@ >>> table = {'Sjoerd': 4127, 'Jack': 4098, 'Dcab': 7678} >>> for name, phone in table.items(): - ... print '%-10s ==> %10d' % (name, phone) + ... print('%-10s ==> %10d' % (name, phone)) ... Jack ==> 4098 Dcab ==> 7678 @@ -159,7 +159,7 @@ shown here:: >>> table = {'Sjoerd': 4127, 'Jack': 4098, 'Dcab': 8637678} - >>> print 'Jack: %(Jack)d; Sjoerd: %(Sjoerd)d; Dcab: %(Dcab)d' % table + >>> print('Jack: %(Jack)d; Sjoerd: %(Sjoerd)d; Dcab: %(Dcab)d' % table) Jack: 4098; Sjoerd: 4127; Dcab: 8637678 This is particularly useful in combination with the new built-in :func:`vars`
