Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 5 : SecondHighest (4 points) Write a function secondHighest that takes a tuple of integers and finds the second largest number in the tuple.
Question 5 : SecondHighest (4 points) Write a function secondHighest that takes a tuple of integers and finds the second largest number in the tuple. The function takes in a tuple of integers as input. If there are multiple instances of the highest number in the tuple (such as in the tuple (1,3,4,9,5,9), where 9 is repeated), the second highest number is not 9, even though there are two nines. The second highest number in this tuple is 5. If the tuple is empty return false ]: def secondMax (data): return # YOUR CODE HERE raise NotImplementedError() ]: print("Test Case 1 : print("Test Case 2 : print("Test Case 3: secondMax((1,2)) == 1) secondMax((1,3,4,9,5,9)) == 5) abs (secondMax((9.1,2.6,2.9,5.8,3.0,1.4,8.2)) - 9.1)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started