Computer Science, asked by vikasamnesh5843, 10 months ago

Describe max(list) method.

Answers

Answered by staeen
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 letmeanswer12
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