The any() and all() functions provide boolean reduction capabilities. Both functions reduce a collection of values to a single True or False. The all() function ensures that all values are True. The any() function ensures that at least one value is True.
These functions are closely related to a universal quantifier and an existential quantifier used to express mathematical logic. We may, for example, want to assert that all elements in a given collection have a property. One formalism for this could look like the following:
We read this as for all x in S, the function, Prime(x), is true. We've put a quantifier, ...