Python 3 - Tuple min() Method


Description

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

Syntax

Following is the syntax for min() method −

min(tuple)

Parameters

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

Return Value

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

Example

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

#!/usr/bin/python3

tuple1, tuple2 = ('maths', 'che', 'phy', 'bio'), (456, 700, 200)
print ("min value element : ", min(tuple1))
print ("min value element : ", min(tuple2))

Result

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

min value element :  bio
min value element :  200
python_tuples.htm
Advertisements