Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
4c8d392b
Commit
4c8d392b
authored
Apr 23, 2012
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reorder the entries to put the type specific technique last.
parent
016878ae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
Doc/tutorial/datastructures.rst
Doc/tutorial/datastructures.rst
+10
-10
No files found.
Doc/tutorial/datastructures.rst
View file @
4c8d392b
...
@@ -577,16 +577,6 @@ keyword arguments::
...
@@ -577,16 +577,6 @@ keyword arguments::
Looping Techniques
Looping Techniques
==================
==================
When looping through dictionaries, the key and corresponding value can be
retrieved at the same time using the :meth:`iteritems` method. ::
>>> knights = {'gallahad': 'the pure', 'robin': 'the brave'}
>>> for k, v in knights.iteritems():
... print k, v
...
gallahad the pure
robin the brave
When looping through a sequence, the position index and corresponding value can
When looping through a sequence, the position index and corresponding value can
be retrieved at the same time using the :func:`enumerate` function. ::
be retrieved at the same time using the :func:`enumerate` function. ::
...
@@ -633,6 +623,16 @@ returns a new sorted list while leaving the source unaltered. ::
...
@@ -633,6 +623,16 @@ returns a new sorted list while leaving the source unaltered. ::
orange
orange
pear
pear
When looping through dictionaries, the key and corresponding value can be
retrieved at the same time using the :meth:`iteritems` method. ::
>>> knights = {'gallahad': 'the pure', 'robin': 'the brave'}
>>> for k, v in knights.iteritems():
... print k, v
...
gallahad the pure
robin the brave
.. _tut-conditions:
.. _tut-conditions:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment