Definition of List max() Function
max() function in Python finds and returns the largest element in that list. Lets understand it better with an Example:
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