Skip to content

Commit 6e2bd3e

Browse files
committed
Fix list manipulation comments and for loop
1 parent ca9c711 commit 6e2bd3e

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
@@ -215,12 +215,12 @@ operations on lists using a different concise syntax.
215215

216216
.. code-block:: python
217217
218-
# Filter elements less than 5
218+
# Filter elements greater than 4
219219
a = [3, 4, 5]
220220
b = []
221221
for i in a:
222-
if a > 4:
223-
b.append(a)
222+
if i > 4:
223+
b.append(i)
224224
225225
**Good**:
226226

@@ -256,7 +256,7 @@ keep a count of your place in the list.
256256
257257
for i, item in enumerate(a):
258258
print i + ", " + item
259-
# prints
259+
# prints
260260
# 0, 3
261261
# 1, 4
262262
# 2, 5

0 commit comments

Comments
 (0)