Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please use wing 101 The centered average of a list of numbers is the arithmetic mean of all the numbers in the list, except for

image text in transcribedplease use wing 101

The centered average of a list of numbers is the arithmetic mean of all the numbers in the list, except for the smallest and largest values. If the list has multiple copies of the smallest or largest values, only one copy is ignored when calculating the mean. For example, given the list [1,1, 5,5,10,8,7], one 1 and the 10 are ignored, and the centered average is the mean of the remaining values; that is, (1+5+5+8+7)/5=5.2. Use the function design recipe to develop a function named centered_average. The function takes a list of integers. Assume that the list has at least three integers. The function returns the centered average of the list. Your function definition must have type annotations and a complete docstring. Your function can call Python's min and max functions, but it is not permitted to call Python's sum function. Your function must have exactly one loop. Use the Python shell to test centered_average

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

1 2 3 Data Base Techniques

Authors: Dick Andersen

1st Edition

0880223464, 978-0880223461

More Books

Students also viewed these Databases questions