Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9dfefbe commit 743e2baCopy full SHA for 743e2ba
1 file changed
Doc/library/operator.rst
@@ -319,15 +319,12 @@ expect a function argument.
319
method. Dictionaries accept any hashable value. Lists, tuples, and
320
strings accept an index or a slice:
321
322
- >>> itemgetter('name')({'name': 'tu', 'age': 18})
323
- 'tu'
324
>>> itemgetter(1)('ABCDEFG')
325
'B'
326
- >>> itemgetter(1,3,5)('ABCDEFG')
+ >>> itemgetter(1, 3, 5)('ABCDEFG')
327
('B', 'D', 'F')
328
- >>> itemgetter(slice(2,None))('ABCDEFG')
+ >>> itemgetter(slice(2, None))('ABCDEFG')
329
'CDEFG'
330
-
331
>>> soldier = dict(rank='captain', name='dotterbart')
332
>>> itemgetter('rank')(soldier)
333
'captain'
0 commit comments