How to Get Min Value from Python List?

By Hardik Savani October 30, 2023 Category : Python

I am going to show you example of python get min value from list. This tutorial will give you simple example of python list find min value. In this article, we will implement a python list get min value index example. it's simple example of python find min value in list of objects.

There are a few ways to get the lowest number from the list in python. i will give you two examples using for loop with min() to get min number from list. so let's see the below examples.

You can use these examples with python3 (Python 3) version.

let's see below a simple example with output:

Example 1:

main.py

myList = [10, 100, 20, 200, 50]
  
# Get Min number from List
minValue = min(myList)
  
print(minValue)

Output:

10

Example 2:

main.py

myList = [10, 100, 20, 200, 50]
  
# Get Max number from List
myList.sort()
minValue = myList[0]
  
print(minValue)

Output:

10

I hope it can help you...

Tags :
Shares