ReferenceBuilt-in functions
min()
The smallest item, optionally judged by a key function.
Signature
min(iterable, key=None, default=...)Parameters
| Name | Means |
|---|---|
iterable | or several separate arguments |
key | called on each item to decide the ordering |
default | returned when the iterable is empty |
Returns
The item itself.
Example
Python
print(min([3, 1, 4]))
print(min(["apple", "fig"], key=len))Output
1 fig