Skip to content

Latest commit

 

History

History
9 lines (9 loc) · 364 Bytes

File metadata and controls

9 lines (9 loc) · 364 Bytes

Max and min

max and min are both variadic, but they also accept iterables:

print(max([1, 3, 2])) # -> 3
print(min([3, 2, 1])) # -> 1

They also both accept a keyword-only argument called key. key is a unary function: if it is provided, the arguments are passed through key before they are compared.