Now you know how to use Python’s built-in min()
and max()
functions to find the smallest and largest values in an iterable or in a series of two or more regular arguments. You also learned about a few other characteristics of min()
and max()
that can make them useful in your day-to-day programming.
In this video course, you learned how to:
- Find the smallest and largest values using Python’s
min()
andmax()
, respectively - Call
min()
andmax()
with a single iterable and with several regular arguments - Use
min()
andmax()
with strings and dictionaries - Customize the behavior of
min()
andmax()
withkey
anddefault
- Feed comprehensions and generator expressions into
min()
andmax()
Additionally, you’ve coded a handful of practical examples using min()
and max()
to approach real-world problems that you might run into while coding. You’ve also a written custom version of min()
and max()
in pure Python, a nice learning exercise that helped you understand the logic behind these built-in functions.
Check out these resources to continue your learning:
- 📰 Working With the Python
operator
Module - 📰 Using the Python
zip()
Function for Parallel Iteration - 🎬 Parallel Iteration With Python’s zip() Function
- 📰 Using the
len()
Function in Python - 🎬 Python’s len() Function
- 📰 When to Use a List Comprehension in Python
- 🎬 Understanding Python List Comprehensions
- 📰 Python args and kwargs: Demystified
- 🎬 Python args and kwargs: Demystified
- 📰 Using Python Optional Arguments When Defining Functions
- 🎬 Defining Python Functions With Optional Arguments
Congratulations, you made it to the end of the course! What’s your #1 takeaway or favorite thing you learned? How are you going to put your newfound skills to use? Leave a comment in the discussion section and let us know.