Python List max() method
Description
The max() method returns the largest element in a list.
Syntax
max() method syntax:
max(list)
Parameters
- list -- the list whose largest element is returned.
Return Value
Returns the largest element in the list.
Example
The following example shows how to use the max() function:
#!/usr/bin/python
list1, list2 = ['123', 'xyz', 'zara', 'abc'], [456, 700, 200]
print "Max value element : ", max(list1);
print "Max value element : ", max(list2);
The output of the above example is:
Max value element : zara
Max value element : 700
Python Lists