Skip to content

Commit 979c882

Browse files
author
Kenneth Reitz
committed
Merge pull request realpython#292 from mattboehm/master
Fix enumerate code snippet to run without error message
2 parents d252d78 + 963ab0a commit 979c882

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/writing/style.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -548,11 +548,11 @@ keep a count of your place in the list.
548548
.. code-block:: python
549549
550550
for i, item in enumerate(a):
551-
print i + ", " + item
551+
print i, item
552552
# prints
553-
# 0, 3
554-
# 1, 4
555-
# 2, 5
553+
# 0 3
554+
# 1 4
555+
# 2 5
556556
557557
The ``enumerate`` function has better readability than handling a counter
558558
manually. Moreover,

0 commit comments

Comments
 (0)