Describe max(list) method.
Answers
Answered by
0
Answer:
The Python max() function returns the largest item in an iterable. It can also be used to find the largest item between two or more parameters.
Answered by
1
max(list) method
Explanation:
The method max() returns maximum value for the elements from the list.
- Syntax - max(list)
- Parameters - (list) − This is a list from which to return max valued item.
- Return Value - This method returns the Maximum value elements from the list.
Example:
- #!/usr/bin/python
- list1, list2 = [123, 'cat', 'zebra', 'lion'], [549, 900, 700]
- print "Max value element : ", max(list1)
- print "Max value element : ", max(list2)
Output:
- Max value element : zebra
- Max value element : 900
Similar questions
Math,
5 months ago
Sociology,
5 months ago
Physics,
5 months ago
Computer Science,
10 months ago
Math,
1 year ago