In contrast with
takewhile which stops the first time it encounters a non-matching value,
filter continues past non-matching values and produces a list containing all of the values that satisfy the predicate.
Here we use
filter in Python to select, from among the natural numbers, only those that are even: