Merge pull request #304 from Duta/patch-1

Update style.rst
This commit is contained in:
Kenneth Reitz
2013-08-14 19:17:51 -07:00
+3 -4
View File
@@ -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**: