Merge pull request #292 from mattboehm/master

Fix enumerate code snippet to run without error message
This commit is contained in:
Kenneth Reitz
2013-07-28 07:51:27 -07:00
+4 -4
View File
@@ -548,11 +548,11 @@ keep a count of your place in the list.
.. code-block:: python
for i, item in enumerate(a):
print i + ", " + item
print i, item
# prints
# 0, 3
# 1, 4
# 2, 5
# 0 3
# 1 4
# 2 5
The ``enumerate`` function has better readability than handling a counter
manually. Moreover,