Max, Any and All
Get familiar with how to use the functions "max", "any", and "all" to reduce iterables.
In this lesson, we’ll look at some more reducing functions.
max
max works in a very similar way to min
, except that it returns the maximum value from an iterable.
Press + to interact
a = [2, 5, 7, 1]print(max(a)) # 7
any
any
accepts an iterable. It will return True
if any of the elements have a true value. It ...