Question: Question 4 : Sub-range Mean Calculator (3 points) Write a function mean that takes a tuple of integers and calculates the mean value (average) of

Question 4 : Sub-range Mean Calculator (3 points) Write a function mean that takes a tuple of integers and calculates the mean value (average) of a range of values within the given tuple. Remember the mean is equal to where x; is each integer in the range of values and n is the number of integers in the tuple Note: If the above calculation would fail for any reason, return false. ]: def mean(data, start, stop): return # YOUR CODE HERE raise NotImplementedError() -,5,2,6,8,2) ]: data = (1,6,2,8,9,1,5,8,2,5,8,2,5,7,9,0,2,5,1,4,6,8,2,6,9,3,5, print("Test Case 1 :", abs (mean(data, , 20) - 4.571)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
