@@ -143,12 +143,14 @@ the position of the object passed into the format method. ::
143143If keyword arguments are used in the format method, their values are referred to
144144by using the name of the argument. ::
145145
146- >>> print 'This {food} is {adjective}.'.format(food='spam', adjective='absolutely horrible')
146+ >>> print 'This {food} is {adjective}.'.format(
147+ ... food='spam', adjective='absolutely horrible')
147148 This spam is absolutely horrible.
148149
149150Positional and keyword arguments can be arbitrarily combined::
150151
151- >>> print 'The story of {0}, {1}, and {other}.'.format('Bill', 'Manfred', other='Georg')
152+ >>> print 'The story of {0}, {1}, and {other}.'.format('Bill', 'Manfred',
153+ ... other='Georg')
152154 The story of Bill, Manfred, and Georg.
153155
154156An optional ``':` `` and format specifier can follow the field name. This also
@@ -176,7 +178,8 @@ instead of by position. This can be done by simply passing the dict and using
176178square brackets ``'[]' `` to access the keys ::
177179
178180 >>> table = {'Sjoerd': 4127, 'Jack': 4098, 'Dcab': 8637678}
179- >>> print 'Jack: {0[Jack]:d}; Sjoerd: {0[Sjoerd]:d}; Dcab: {0[Dcab]:d}'.format(table)
181+ >>> print ('Jack: {0[Jack]:d}; Sjoerd: {0[Sjoerd]:d}; '
182+ ... 'Dcab: {0[Dcab]:d}'.format(table))
180183 Jack: 4098; Sjoerd: 4127; Dcab: 8637678
181184
182185This could also be done by passing the table as keyword arguments with the '**'
0 commit comments