Question: use python Q3:Clever average Often enough, we would like to ignore outliers in the data set and calculate the average without these extremes. Write a
Q3:Clever average Often enough, we would like to ignore outliers in the data set and calculate the average without these extremes. Write a function, clever_ average, which takes in a list of integers, nums and returns a "clever average": This average ignores smallest and largest numbers in the list. If there are more than one copy of the smallest (largest) number, ignore just one copy. Use integer division to calculate your answer You can assume that the given list will always have 3 or more elements in it. Hint: There is a solution that does not use loops After you are done with the code, insert an assert statement that checks whether the input is indeed a list. Use the following error message "Input must be a list def clever_average (nums) s>> clever_average ([4, 0, 1001) >> clever_average (7, 7, 71) >>> clever average (E-10, -4, 2, 4, 2, 0]) # YOUR CODE IS HERE #
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
