Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Python List min() method

Python List min() method

Python Lists Python Lists


Description

The min() method returns the smallest element in a list.

Syntax

min() method syntax:



min(list)

Parameters

Return Value

Returns the smallest element in the list.

Example

The following example shows 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:



min value element :  123

min value element :  200

Python Lists Python Lists