@@ -234,7 +234,7 @@ Here we take a list of numbers and return a list of three times each number::
234234
235235Now we get a little fancier::
236236
237- >>> [[x,x**2] for x in vec]
237+ >>> [[x, x**2] for x in vec]
238238 [[2, 4], [4, 16], [6, 36]]
239239
240240Here we apply a method call to each item in a sequence::
@@ -243,7 +243,7 @@ Here we apply a method call to each item in a sequence::
243243 >>> [weapon.strip() for weapon in freshfruit]
244244 ['banana', 'loganberry', 'passion fruit']
245245
246- Using the if- clause we can filter the stream::
246+ Using the :keyword: ` if ` clause we can filter the stream::
247247
248248 >>> [3*x for x in vec if x > 3]
249249 [12, 18]
@@ -260,7 +260,7 @@ Tuples can often be created without their parentheses, but not here::
260260 >>> [(x, x**2) for x in vec]
261261 [(2, 4), (4, 16), (6, 36)]
262262
263- Here are some nested for's and other fancy behavior::
263+ Here are some nested for loops and other fancy behavior::
264264
265265 >>> vec1 = [2, 4, 6]
266266 >>> vec2 = [4, 3, -9]
@@ -273,7 +273,7 @@ Here are some nested for's and other fancy behavior::
273273
274274List comprehensions can be applied to complex expressions and nested functions::
275275
276- >>> [str(round(355/113.0, i)) for i in range(1,6)]
276+ >>> [str(round(355/113.0, i)) for i in range(1, 6)]
277277 ['3.1', '3.14', '3.142', '3.1416', '3.14159']
278278
279279
@@ -469,7 +469,7 @@ with the :func:`zip` function. ::
469469To loop over a sequence in reverse, first specify the sequence in a forward
470470direction and then call the :func: `reversed ` function. ::
471471
472- >>> for i in reversed(range(1,10,2)):
472+ >>> for i in reversed(range(1, 10, 2)):
473473 ... print(i)
474474 ...
475475 9
0 commit comments