Python Tuple min() Method

Python 元组Python Tuple


Description

Python tuple min() function returns the minimum value of elements in the tuple.

Syntax

min() method syntax:

min(tuple)

Parameters

  • tuple -- The specified tuple.

Return Value

Returns the minimum value of elements in the tuple.

Example

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

#!/usr/bin/python

tuple1, tuple2 = (123, 'xyz', 'zara', 'abc'), (456, 700, 200)

print "min value element : ", min(tuple1);
print "min value element : ", min(tuple2);

The output of the above example is:

min value element :  123
min value element :  200

Python 元组Python Tuple

Other Extensions