
Max B. answered 04/06/23
University lecturer & senior engineer tutoring Python, other languages
This is called "vacuous truth" in math. Let's consider another way to think about the `all` function: it looks for exceptions. It looks over the list, trying to find any value that is False. If there are no elements, there are no False values. So it returns True.
The same goes for `any`. It looks over the list, trying to find any values that are True. If there are no elements, there are no True values. So it returns False.