Python’s min() and max(): Find Smallest and Largest Values
![](https://www.deeplearningdaily.com/wp-content/uploads/2022/05/pythons-min-and-max-find-smallest-and-largest-values_62701a56eb3d3-375x210.jpeg)
Python’s built-in min()
and max()
functions come in handy when you need to find the smallest and largest values in an iterable or in a series of regular arguments. Even though these might seem like fairly basic computations, they turn out to have many interesting use cases in real-world programing. You’ll try out some of those use cases here.
In this tutorial, you’ll learn how to:
- Use Python’s
min()
andmax()
to find smallest and largest values in your data - Call
min()
andmax()
with a single iterable or with any number of regular arguments - Use
min()
andmax()
with strings and dictionaries - Tweak the behavior of
min()
andmax()
with thekey
anddefault
arguments - Use comprehensions