 Hey, what's going on guys? Rudlinal here bringing you back with another Python tutorial now in the last video We took a look at the minimum function or the min function and that let us get the minimum value of a list or an array Or that sort of thing so today I figured it makes more sense to check out the maximum function and try and recreate that For ourselves and that's obviously a lot similar to the minimum function In fact, all it is is changing a comparison operator. So let's get idle started and I'll show you what I mean So let's get idle creating new Python shell here Python program file dot Python you can save it as whatever you'd like obviously You don't need a shebang you line if you're working on Windows, but I being in Linux do need one will create a base class and get a constructor going Passing the self keyword as always We'll pass something there for now and then we'll test if this is the current script Name is equal to Main because that's a good practice to get into and now we can use root which is a instance of our base object class So let's define Get maximum obviously we need some parameters here We need self and then we need the array So let's give it a go. We're gonna want to go for each item in our array This is gonna be set up almost exactly the same as last time If the item is equal to the first element in the array Remember we have to use zero to index the very beginning We can set maximum to be Eray, I'm sorry the first index that we're looking at if it's not If remember we could combine these else in that if statement with an elif statement, but I myself don't like those Obviously if you want to use them feel free Else if let's see the current item is greater than the maximum Maximum can equal that item and then when we're done looping we can return the maximum number So let's get back up to our constructor here and let's see what we can do self dot numbers let's say Little list going and we can have let's say negative two negative twenty three negative one zero Let's throw in on a hundred somewhere in there and maybe a fifty four fifty three anyway negative two again a negative number anyway, and then how about nine hundred nine nine thousand maybe thirty 354 and then if we Run our self dot actually won't we'll want to print the output of what we get here self dot Get maximum We can pass in self dot numbers and we should get nine thousand and that's because it is the highest number here And we've repeated and we've gone through this array that we just passed in and we've looked for the maximum number by testing it for The first time and setting it to the first thing that we see and if we find anything greater than that We will reset the maximum number to be that and when we're done looping we just display the one that we found and We're all done. Thanks for watching guys. I hope you enjoyed this I know it was very simple and pretty similar to the last tutorial But it is just a matter of changing your comparison operator. I'll see you in the next tutorial. Bye