Easy Tutorial
❮ Python Five Fish Python String Splitlines ❯

Python3 List min() Method

Python3 List


Description

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

Syntax

Syntax for the min() method:

min(list)

Parameters

Return Value

Returns the smallest element in the list.

Example

The following example demonstrates the use of the min() function:

#!/usr/bin/python3

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

print ("list1 smallest element : ", min(list1))
print ("list2 smallest element : ", min(list2))

The output of the above example is as follows:

list1 smallest element :  Google
list2 smallest element :  200

Python3 List

❮ Python Five Fish Python String Splitlines ❯