Ask Question
9 May, 04:17

Define the function max2 that takes two integers as arguments and returns the largest of them. Then define the function max_list that returns the largest of the elements in a nonempty list of integers by calling max2

+5
Answers (1)
  1. 9 May, 08:03
    0
    def max_list (a):

    return max (a)

    def max2 (a, b):

    return max (a, b)

    s=max2 (2,3)

    print ('max of two number is:')

    print (s)

    a=[1,2,3,4,5,6,7,8,9,10]

    max_in_list = max_list (a)

    print ('/n max element in whole list is:')

    print (max_in_list)

    Explanation:

    Above program is written in python:

    Function max2 accept two parameters and return one which is greatest of both and funtion max_list accept a parameter list and returns the greatest number in list.

    Note: take care of indentation of function while pasting this code on your compiler or ide
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Define the function max2 that takes two integers as arguments and returns the largest of them. Then define the function max_list that returns ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers