From the course: Advanced Python: Working With Data
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Finding min and max values - Python Tutorial
From the course: Advanced Python: Working With Data
Finding min and max values
- [Instructor] In this example, we'll see how to use the min and max functions to find the smallest and largest data values in a given data set. And so here I am in my GitHub repository. And remember, you're going to want to make a fork of this in your own GitHub. And I've already got a codespace up and running so you'll need to make one of your own codespaces. So I'm going to bring up my codespace. All right. Once my codespace is up and running, I'm going to go into the Start folder. And in chapter one, I'm going to open the minmax file. So here at the top of my code, I have two lists, right? One is a set of numbers and the other is a set of string. So let's use the min function to find the smallest value in each of these lists. So I'll print out the result, and I'm going to use an f-string to do this. And I'll just simply write, "The minimum value is," and I'll call the min function on the values list. And I'll do the…