August 2019
Beginner
482 pages
12h 56m
English
all and any both take an array as their input and are logical expansions of & and | for more than two variables. Essentially, they are equal to repeating & or | for all the elements of the array. Here is an example:
>>> all((True, False, True))False>>> any((True, False, False))True
In the first case, the function returns False, as there is at least one False instance in the iterable. In the second case, there is at least one True instance, so that function returns True as well.
Read now
Unlock full access