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

Python Tuple max() method

Python Tuple max() method

Python TuplePython Tuple


Description

The Python tuple max() function returns the maximum value among the elements of a tuple.

Syntax

max() method syntax:



max(tuple)

Parameters

Return Value

Returns the maximum value among the elements of a tuple.

Example

The following example shows how to use the max() function:



#!/usr/bin/python



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



print "Max value element : ", max(tuple1);

print "Max value element : ", max(tuple2);

The output of the above example is:



Max value element :  zara

Max value element :  700

Python TuplePython Tuple