Python 3 - List min() Method


Advertisements

Description

The min() method returns the elements from the list with minimum value.

Syntax

Following is the syntax for min() method −

min(list)

Parameters

list − This is a list from which min valued element to be returned.

Return Value

This method returns the elements from the list with minimum value.

Example

The following example shows the usage of min() method.

#!/usr/bin/python3

list1, list2 = ['C++','Java', 'Python'], [456, 700, 200]
print ("min value element : ", min(list1))
print ("min value element : ", min(list2))

Result

When we run above program, it produces the following result −

min value element :  C++
min value element :  200
python_lists.htm
Advertisements