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

Python3 List min() Method

Python3 List min() Method

Python3 Lists The Python3 list


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/python3

list1, list2 = ['Google', 'Runoob', 'Taobao'], [456, 700, 200]

print ("list1 最小元素值 : ", min(list1))
print ("list2 最小元素值 : ", min(list2))

The output of the above example is:


list1 最小元素值 :  Google
list2 最小元素值 :  200

Python3 Lists The Python3 list