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 ca9c711 commit 6e2bd3eCopy full SHA for 6e2bd3e
docs/writing/style.rst
@@ -215,12 +215,12 @@ operations on lists using a different concise syntax.
215
216
.. code-block:: python
217
218
- # Filter elements less than 5
+ # Filter elements greater than 4
219
a = [3, 4, 5]
220
b = []
221
for i in a:
222
- if a > 4:
223
- b.append(a)
+ if i > 4:
+ b.append(i)
224
225
**Good**:
226
@@ -256,7 +256,7 @@ keep a count of your place in the list.
256
257
for i, item in enumerate(a):
258
print i + ", " + item
259
- # prints
+ # prints
260
# 0, 3
261
# 1, 4
262
# 2, 5
0 commit comments