Python3 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/python3 list1, list2 = ['Google', 'w3big', 'Taobao'], [456, 700, 200] print ("list1 最大元素值 : ", max(list1)) print ("list2 最大元素值 : ", max(list2))
Examples of the above output results are as follows:
list1 最大元素值 : Taobao list2 最大元素值 : 700