Python Tuple max() method
Description
The Python tuple max() function returns the maximum value among the elements of a tuple.
Syntax
max() method syntax:
max(tuple)
Parameters
- tuple -- the specified tuple.
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 Tuple