From c666597a73b05f2656d1737de7b9f8ef4794cc11 Mon Sep 17 00:00:00 2001 From: Duta Date: Mon, 12 Aug 2013 12:44:37 +0100 Subject: [PATCH] Update style.rst --- docs/writing/style.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/writing/style.rst b/docs/writing/style.rst index 57a814eed..e48956a2e 100644 --- a/docs/writing/style.rst +++ b/docs/writing/style.rst @@ -516,6 +516,7 @@ more concise syntax. .. code-block:: python + a = [3, 4, 5] b = [i for i in a if i > 4] b = filter(lambda x: x > 4, a) @@ -525,10 +526,8 @@ more concise syntax. # Add three to all list members. a = [3, 4, 5] - count = 0 - for i in a: - a[count] = i + 3 - count = count + 1 + for i in range(len(a)): + a[i] += 3 **Good**: