Latest web development tutorials

Python Tuple (tuple) max () method

description

Python tuple max () function returns the maximum element tuple.

grammar

max () method syntax:

max(tuple)

parameter

  • tuple - tuple specified.

return value

Returns the maximum element tuple.

Examples

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

#!/usr/bin/python

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

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

Examples of the above output results are as follows:

Max value element :  zara
Max value element :  700