[10 marks Write a Python function called fake_average (aList) that returns the average of the smallest...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
[10 marks Write a Python function called fake_average (aList) that returns the average of the smallest and largest values in alist. For example: take average ((2, 1, 3, 51) should return the value 3 (the average of 1 and 5) take average ((1, 1, 1, 1, 21) should return the value 1.5 (the average of 1 and 2) • take average ((5, 5, 5, 5, 5, 51) should return the value 5 (the average of 5 and 5) Submission instructions • Your program must include a comment at the top with your name and the question number. Your file name should be final_q3_INITIAL_LASTNAME.sb3 (eg., if your name is Rob Alen, your submission would be final_q3_R_Allen.py) [10 marks Write a Python function called fake_average (aList) that returns the average of the smallest and largest values in alist. For example: take average ((2, 1, 3, 51) should return the value 3 (the average of 1 and 5) take average ((1, 1, 1, 1, 21) should return the value 1.5 (the average of 1 and 2) • take average ((5, 5, 5, 5, 5, 51) should return the value 5 (the average of 5 and 5) Submission instructions • Your program must include a comment at the top with your name and the question number. Your file name should be final_q3_INITIAL_LASTNAME.sb3 (eg., if your name is Rob Alen, your submission would be final_q3_R_Allen.py)
Expert Answer:
Answer rating: 100% (QA)
This is the code to compute the average The function of the various ... View the full answer
Related Book For
Data Structures and Algorithms in Python
ISBN: 978-1118290279
1st edition
Authors: Michael T. Goodrich , Roberto Tamassia, Michael H. Goldwasser
Posted Date:
Students also viewed these databases questions
-
Write a recursive method that returns the number of 1's in the binary representation of N. Use the fact that this is equal to the number of 1's in the representation of N/2, plus 1, if N is odd.
-
Write a method that returns the index of the smallest element in an array of integers. If the number of such elements is greater than 1, return the smallest index. Use the following header: public...
-
Write a method called average that returns the average of the values in the list as a real number. For example, if a variable called list stores [11, 7, 3, 42, 0, 14], the call of list.average()...
-
Given this expression, what can we say about the problem domain? tBoat (BoatSerialNo, BoatType, Manufacturer, Price, Customer, Date Of Sales Rep) SalesRep should not be in the expression at all...
-
For any group G prove that G is abelian if and only if (ab)2 = a2b2 for all a, b G.
-
Let Ω s be the solid angle subtended by the source when viewed from the center of the aperture screen. Show that represents the coherence area. This equation is useful when we dont know...
-
Taj Mahabub was the founder and CEO of GenAudio, a Colorado-based audio technology company. GenAudio had struggled financially practically since its formation, and Mahabub wished to secure a...
-
Youre the manager of global opportunities for a U.S. manufacturer, who is considering expanding sales into Europe. Your market research has identified three potential market opportunities: England,...
-
Before boarding her flight to Zurich, Switzerland, Mary purchased CHF850 from her bank when the exchange rate was C$1 = CHF0.9651. However, Mary had to cancel the trip. Mary returned to the bank to...
-
The OLTP system data for the Fitchwood Insurance Company is in a series of flat files. What process do you envision would be needed in order to extract the data and create the ERD shown in Figure...
-
The road constructed on a civil engineering construction cuts off an un-economical portion of the property of a land owner. The sketch below shows the existing boundary lines AK and KL. K 1.2 A...
-
Use a double integral in polar coordinates to show that the volume of a circular cone with base radius r and height h is rh
-
An analyst who believes in the Treynor - Black Model has identified one active stock, stock A, which he/she wants to combine with the passive Market Index M to form their firm's optimal risky...
-
To hold hydraulic jumps, baffle walls are provided in (A) Sarda type falls (B) English type falls (C) Montague type falls (D) Vertical type falls
-
In assessing data that fell into two phenotypic classes, a geneticist observed values of 800: 680. She decided to perform a chi-square analysis by using the following null hypothesis: The data fit...
-
Adkins Appliances buys 4,000 common shares of Charlie Corporation for $40 per share on January 2 of the current year. Adkins Appliances does not have the ability to participate in the decisions of...
-
NBC company is expected to pay a $1.60 per share dividend at the end of this year (i.e., D 1 =$1.60). The dividend is expected to grow at a constant rate of 10% a year from the current period to the...
-
This problem continues the Draper Consulting, Inc., situation from Problem 12-45 of Chapter 12. In October, Draper has the following transactions related to its common shares: Oct 1 Draper...
-
Let T be a red-black tree and let p be the position of the parent of the original node that is deleted by the standard search tree deletion algorithm. Prove that if p has one child, the deletion has...
-
Draw an adjacency list representation of the undirected graph shown in Figure 14.1.
-
Demonstrate how to use Pythons list comprehension syntax to produce the list [1, 2, 4, 8, 16, 32, 64, 128, 256].
-
Many hotel jobs are inherently dead end; for example, maids, laundry workers, and valets, either have no great aspirations to move up, or are just using these jobs temporarily, for instance, to help...
-
Using what you learned in this chapter of Dessler Human Resource Management, build on the companys new system by recommending two more specific career development activities the hotel should...
-
Should other employees (cleaner/spotters, counter people) be put on a similar plan? Why or why not? If so, how exactly?
Study smarter with the SolutionInn App