Saturday, March 24, 2018

List max( ) Method


List max( ) Method


The max() method returns the elements from the list with maximum value.

Syntax

max(list)

Parameters
    list - This is a list from which max valued element are to be returned.
Return Value
This method returns the elements from the list with maximum value.
  
Example
#!/usr/bin/python3

list1, list2 = ['C++','Java', 'Python'], [156, 900, 400]
print ("Max value element : ", max(list1))
print ("Max value element : ", max(list2))

When we run above program, it produces following result-
Max value element : Python
Max value element : 900





<<<  List len( ) method                Go to Index       min( ) method >>>