Python List min() Method

Python 列表Python Lists


Description

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

Syntax

The syntax of the min() method is:

min(list)

Parameters

  • list -- A list from which the minimum value is to be returned.

Return Value

Returns the minimum value among the list elements.

Examples

The following example demonstrates how to use the min() function:

#!/usr/bin/python

list1, list2 = [123, 'xyz', 'zara', 'abc'], [456, 700, 200]

print "min value element : ", min(list1);
print "min value element : ", min(list2);

The output of the above example is as follows:

min value element :  123
min value element :  200

Python 列表Python Lists

Other Extensions