Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

use python image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Knowledge Discovery In Databases

Authors: Gregory Piatetsky-Shapiro, William Frawley

1st Edition

ISBN: 0262660709, 978-0262660709

More Books

Students also viewed these Databases questions

Question

5-8 What are the advantages and disadvantages of the BYOD movement?

Answered: 1 week ago