Please complete the function find_max,which returns the largest number in the given sequence. hint: -math.inf will give you an infinitly small number Note, using built-in max() function will not be rewarded any mark import math def find_max(seq): #INSERT YOUR CODE BELOW # ~4 LINES my_max = .. ... return my_max ==== ==== ===== === #TEST CASES BELOW 23 li = [5, 6, 7, 8] v = find_max(li) print(f'answer": {max(li)} your answer: {v}') li = [12, 34, 56, 98] v = find_max(li) print(f'answer": {max(li)} your answer: {v}') [-321, -2933, -452, -1029] v = find_max(li) print(f'answer": {max(li)} your answer: {v}') li =

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section: Chapter Questions
Problem 4PP
icon
Related questions
Question

Solve in python. do not use the max function.

Please complete the function find_max, which returns the largest number in the given sequence.
hint: -math.inf will give you an infinitly small number
Note, using built-in max() function will not be rewarded any mark
import math
def find_max(seq):
#INSERT YOUR CODE BELOW
# ~4 LINES
my_max =...
...
return my_max
#======
======
#TEST CASES BELOW
#==
li = [5, 6, 7, 8]
v = find_max(li)
print(f'answer": {max(li)} your answer: {v}')
li = [12, 34, 56, 98]
find_max(li)
print(f'answer": {max(li)} your answer: {v}')
V =
li = [-321, -2933, -452, -1029]
v = find_max(li)
print(f'answer": {max(li)} your answer: {v}')
Transcribed Image Text:Please complete the function find_max, which returns the largest number in the given sequence. hint: -math.inf will give you an infinitly small number Note, using built-in max() function will not be rewarded any mark import math def find_max(seq): #INSERT YOUR CODE BELOW # ~4 LINES my_max =... ... return my_max #====== ====== #TEST CASES BELOW #== li = [5, 6, 7, 8] v = find_max(li) print(f'answer": {max(li)} your answer: {v}') li = [12, 34, 56, 98] find_max(li) print(f'answer": {max(li)} your answer: {v}') V = li = [-321, -2933, -452, -1029] v = find_max(li) print(f'answer": {max(li)} your answer: {v}')
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Function Arguments
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr