Answered step by step
Verified Expert Solution
Question
1 Approved Answer
use python and donot use loops Q3: Clever average Often enough, we would like to ignore outliers in the data set and calculate the average
use python and donot use loops 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) >>> clever_average (4, 0, 1001) >>> clever average (7, 7, 71) >>clever average ([-10, -4, -2, 4, -2, 01) # YOUR CODE IS HERE #
use python and donot use loops
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered 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