summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2014-11-14 11:12:53 +0100
committerGeorg Brandl <georg@python.org>2014-11-14 11:12:53 +0100
commit1a8a2927b394f0593993364ef4e1d293d7b9376e (patch)
treef4ca695f6c9f437acdca77d684651a55a18bc443
parentf1960bd172fb06f406bcea3527b9125037a479c6 (diff)
downloadcpython-1a8a2927b394f0593993364ef4e1d293d7b9376e.tar.gz
Closes #22868: make example less ambiguous.
-rw-r--r--Doc/tutorial/datastructures.rst6
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/tutorial/datastructures.rst b/Doc/tutorial/datastructures.rst
index acc2cc1c8f..8643d11070 100644
--- a/Doc/tutorial/datastructures.rst
+++ b/Doc/tutorial/datastructures.rst
@@ -181,12 +181,12 @@ There are three built-in functions that are very useful when used with lists:
the sequence for which ``function(item)`` is true. If *sequence* is a
:class:`string` or :class:`tuple`, the result will be of the same type;
otherwise, it is always a :class:`list`. For example, to compute a sequence of
-numbers not divisible by 2 or 3::
+numbers divisible by 2 or 3::
- >>> def f(x): return x % 2 != 0 and x % 3 != 0
+ >>> def f(x): return x % 3 == 0 or x % 5 == 0
...
>>> filter(f, range(2, 25))
- [5, 7, 11, 13, 17, 19, 23]
+ [3, 5, 6, 9, 10, 12, 15, 18, 20, 21, 24]
``map(function, sequence)`` calls ``function(item)`` for each of the sequence's
items and returns a list of the return values. For example, to compute some