Function Details: min

Description


Returns the smallest item in an iterable or the smallest of two or more arguments.


Extended Description


The min() function returns the smallest item in an iterable or the smallest of two or more arguments. It can be used with many different types, including numbers, strings, and custom objects. The optional 'key' argument specifies a function of one argument that is used to extract a comparison key from each element. The 'default' argument is returned if the iterable is empty.


Read More about min from Python Documentation

Function Signature


min(*args, key: Optional[Callable] = None, default: Optional[Any] = None) -> Any

Module: builtins

Parameters



Parameter List


  • *args: Any
  • key: Optional[Callable]
  • default: Optional[Any]

Return


Returns the minimum value from the given arguments or iterable.


Return Type


Any

Output

Explanation

These examples show how to use min() with direct arguments, a list, and a range object.