Python List max() Method Syntax
max(listname)
Parameter
- listname : Name of list in which we have to find the maximum value.
Returns : It return the maximum value present in the list.
Python List max() Method
Python list max() function returns the maximum value present in the list.
Example:
Python3
#creating a list rand = [ 2 , 3 , 6 , 1 , 8 , 4 , 9 , 0 ] #printing max element print ( max (rand)) |
Output
9