python-tutorialsmade

Python program to find Largest & Smallest number in a list

In this post, we are going to write a simple Python script to find the largest and the smallest number in a list.

It is really simple to find the largest and smallest number in a list using Python function max() and min() respectively, let’s write the program so you can understand it easily.

As you can see the above python script, we have created a list called “mylist” with 6 numbers [20,65,100,5,30,6]. The smallest number in our list is 5 and the largest number is 100. So to find the smallest number we have used the Python function min(mylist) and to find the largest number we have used max(mylist).

The output of the above Python script will be:

Thank you for your time to read this post, I hope this would have helped you.

Related Posts

Leave a Reply