How to Get Min Value from List in Python?

21-Nov-2022

.

Admin

How to Get Min Value from List in Python?

Hi Dev,

Today our leading topic is how to get min value from list in python. I would like to show you python find min value in list of objects. I’m going to show you about how to get min value from python list. if you have question about python list get min value index example then I will give simple example with solution. you will do the following things for python list find min value.

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.

so let's see following examples 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

#Python