Python min() Function
The min() function returns the item with the lowest value, or the
item with the lowest value in an iterable.
If the values are strings, an alphabetically comparison is done.
Syntax
min(n1, n2, n3, ...)
Or
min(iterable)
Parameters
| Parameter | Description |
|---|---|
n1, n2... |
One or more items to compare |
iterable |
An iterable object containing items to compare |
Return Value
The smallest item.
Example
Using the min() function:
Output
Click Run to execute your code
Enjoying these tutorials?