Skip to content
Built-in Functions

min()

Find the smallest item in an iterable.

min(iterable, *, key=None, default=...)

min() returns the smallest item in an iterable or the smallest of two or more arguments.

Parameters

NameDescription
iterableItems to compare.
keyOptional function used to choose how items are compared.
defaultOptional value returned for an empty iterable.

Returns

The smallest item.

Try it

Run it and change it
temperatures = [18, 12, 16]
print(min(temperatures))

Worth knowing

  • Key function: min(words, key=len) finds the shortest string in a collection.

Related entries