🚀 Supercharge your YouTube channel's growth with AI.
Try YTGrowAI FreeLowest Python Values with min()

Comparing a few Python values or finding the smallest item in a list calls for a way to select the minimum. min() returns the lowest item from an iterable or from separate arguments.
This article explains both ways to use min() and how to get the index of the selected item.
TL;DR: Find the Lowest Value with min()
Call min(values) to return the lowest item in an iterable, or pass multiple arguments to compare a short set of candidates.
- Use key= to compare by a field or transformation while returning the original item.
- Use default= to define the result for an empty iterable.
- Use enumerate() with key= when the index matters.
What Is Python min()?
Though the title calls it a method, min() is a built-in function that selects a lowest item from an iterable or a set of arguments.
I used the value field in the record example because it selects by the field the reader cares about.
min(iterable, *, key=None)
min(iterable, *, default, key=None)
min(arg1, arg2, *args, key=None)
How to Find the Lowest Value Step by Step
Use the iterable form for a collection and the separate-argument form for individual candidates.
Step 1: Pass the collection as one iterable
A list of numbers is a common input. min() returns the lowest value without reordering the list.
prices = [12.50, 8.75, 10.00, 8.75]
print(min(prices))
The output is 8.75.
Step 2: Pass separate values when you already have them
Pass separate arguments when the candidates are already individual values. For a collection, keep the values together.
print(min(12.50, 8.75, 10.00))
The result is 8.75, and separate list arguments are compared as whole lists, item by item.
Step 3: Supply a key for a different comparison
The key callable receives each item and returns the value used for comparison. min() still returns the original item, so it works for records as well as transformed strings.
names = ["pear", "Plum", "apple"]
print(min(names))
print(min(names, key=str.casefold))
records = [("Mira", 18), ("Sam", 15), ("Lee", 15)]
print(min(records, key=lambda record: record[1]))
Default string comparison is case-sensitive. Using str.casefold changes the result from Plum to apple, while the record key returns the original tuple.
Step 4: Keep the index with the winning value
Use enumerate() when you need the position with the value.
prices = [12.50, 8.75, 10.00, 8.75]
print(min(enumerate(prices), key=lambda item: item[1]))
The result is (1, 8.75), the first tied minimum at index 1. See AskPython’s Python indexing guide.
Step 5: Choose the empty-input behavior
print(min([], default="no values"))
The result is no values. This default is returned only for an empty iterable. If None can also appear in the data, use a unique object sentinel to distinguish it.
8.75
8.75
Plum
apple
('Sam', 15)
(1, 8.75)
no values
3 3 [14, 3, 9, 3, 11]
Empty Inputs, Ties, and Other Edge Cases
Choose a fallback for empty data, and account for ties or values Python cannot compare.
| Case | Symptom | Response |
|---|---|---|
| Empty iterable | ValueError without default | Choose a suitable default or validate input |
| Tied minimum | First matching item is returned | Scan with enumerate() to collect every matching position |
| Incompatible types | TypeError during comparison | Normalize items or key results |
I ran python3 min_empty_failure.py on an empty list without default and got ValueError: min() arg is an empty sequence.
See the Python sorting guide and AskPython’s smallest-number examples.
Conclusion
Use min() for one lowest item. Sort when the full order matters.
For argument rules, see the Python min() reference and the sorting guide.
FAQ
These answers cover common questions about finding the lowest value in Python.
How do I find the lowest number in a Python list?
Call min(numbers). It returns the lowest item without sorting or changing the list.
How can I get the index of the lowest value?
Use min(enumerate(values), key=lambda pair: pair[1]) to get the first index and its value. Use enumerate with a comparison when every tied index is needed.
What happens when min() receives an empty list?
Without default, min() raises ValueError. With min(values, default=None), it returns None when the iterable is empty.
How do I find the lowest value in a dictionary?
Use min(data.values()) for the value alone, or min(data, key=data.get) for the key whose mapped value is lowest.


