python tuple - min function

To find the minimum value among the elements present in a Python Tuple object use the min function

Tuple Updated 18 Sep 2016 1 min read

Function Name

min

Function Signature

min(tupleObject)

Parameters

tuple_in: The tuple object in which the smallest of elements to be found.

Return Value

The smallest of the items present in the tuple object.

Function Overview

  • The min() function returns the smallest of the elements present in a Python tuple.

Example

python
# Example Python program that creates

            # a tuple of numbers and finds the

            # smallest element present

# Create a tuple

            quadruple   = [5, 7, 1, 6]

# Find the smallest element present in the tuple

            smallest    = min(quadruple)

print("Elements of the tuple:{0}".format(quadruple))

            print("The smallest element present in the tuple:{0}".format(smallest))

Output

Output
Elements of the tuple:[5, 7, 1, 6]

The smallest element present in the tuple:1