From b3f04bc23e4c69f85ac00ecbb61d71230c1464cd Mon Sep 17 00:00:00 2001 From: Thibaut Horel Date: Sun, 24 Feb 2013 21:21:37 +0100 Subject: Typo fix --- content/python-best-practices.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/python-best-practices.rst b/content/python-best-practices.rst index 167f5ab..1457f9f 100644 --- a/content/python-best-practices.rst +++ b/content/python-best-practices.rst @@ -75,7 +75,7 @@ comprehensions* (very original, isn't it?). For example, to transform a list of .. code-block:: python - l = [("Barthes", "+33 6 29 64 91 12"), ("Dumbo", "+001 650 472 4243")] + l = [("Barthes", "+33 6 29 64 91 12"), ("John", "+001 650 472 4243")] d = {name: phone for (name, phone) in l} You can get more details about *list comprehensions* on the `dedicated section `__ of the official documentation. @@ -168,12 +168,12 @@ regard: .. code-block:: python - l = ["Dumbo", "Polochon"] + l = ["Adam", "Eve"] def reverse(word): return word[::-1] - m = map(reverse, l) # m = ['obmuD', 'nohcoloP'] + m = map(reverse, l) # m = ['madA', 'evE'] *slices* are also very useful when it comes to manipulating lists (or sublists) in blocks. Remember that if ``l`` is a list (or any iterable) -- cgit v1.2.3-70-g09d2