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.
SyntaxOr:
Parameter Values Parameter Description n1, n2, n3, ... One or more items to compareOr:
Parameter Description iterable An iterable, with one or more items to compare More Examples ExampleReturn the name with the lowest value, ordered alphabetically:
x = min("Mike", "John", "Vicky")
Try it Yourself » ExampleReturn the item in a tuple with the lowest value:
a = (1, 5, 3, 9)
x = min(a)
The max() function, to return the highest value.
Track your progress - it's free!
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4