Ask Question
3 December, 21:41

Write a function called find_max that takes in a single parameter called random_list, which should be a list. This function will find the maximum (max) value of the input list, and return it. This function will assume the list is composed of only positive numbers. To find the max, within the function, use a variable called list_max that you initialize to value 0. Then use a for loop to loop through random_list. Inside the list, use a conditional to check if the current value is larger than list_max, and if so, re-assign list_max to store this new value. After the loop, return list_max, which should now store the maximum value from within the input list.

+2
Answers (1)
  1. 3 December, 23:32
    0
    see explaination

    Explanation:

    python code

    def find_max (random_list):

    list_max=0

    for num in random_list:

    if num > list_max:

    list_max=num

    return list_max

    print (find_max ([1,45,12,11,23]))
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write a function called find_max that takes in a single parameter called random_list, which should be a list. This function will find the ...” 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