Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6e2bd3e

Browse files
committed
Fix list manipulation comments and for loop
1 parentca9c711 commit6e2bd3e

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 elementsless than5
218+
# Filter elementsgreater than4
219219
a= [3,4,5]
220220
b= []
221221
for iin a:
222-
ifa>4:
223-
b.append(a)
222+
ifi>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, iteminenumerate(a):
258258
print i+","+ item
259-
# prints
259+
# prints
260260
# 0, 3
261261
# 1, 4
262262
# 2, 5

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp