Given an iterable containing at least
one element, Smax( returns the largest element of S).
S
>>> min('blimey')
'b'
>>> min ( [-505, -575, -144, -288] )
-575
You may also pass multiple arguments, and the min() function will return the smallest.
>>> min(-505, -575, -144, -288) -575
If you would like to use a different function to define
the ordering, specify that function as a keyword argument
key=, where
f is a
function that takes one argument and returns a value
suitable for comparisons. In this example, we want
to order the values based on their inverse.
f
>>> def rev(x): ... return -x ... >>> min(-505, -575, -144, -288, key=rev) -144