Python List max () method
description
max () method returns a list of elements maximum.
grammar
max () method syntax:
max(list)
parameter
- list - the list to return the maximum value.
return value
Returns a list of elements maximum.
Examples
The following example shows the max () function to use:
#!/usr/bin/python list1, list2 = [123, 'xyz', 'zara', 'abc'], [456, 700, 200] print "Max value element : ", max(list1); print "Max value element : ", max(list2);
Examples of the above output results are as follows:
Max value element : zara Max value element : 700