Question: Write and test a function that meets the following requirements: def list_2d_stats(values): ------------------------------------------------------- Returns statistics on a 2D list. ------------------------------------------------------- Preconditions: values - a
Write and test a function that meets the following requirements:
def list_2d_stats(values): """ ------------------------------------------------------- Returns statistics on a 2D list. ------------------------------------------------------- Preconditions: values - a 2D list of numbers (2D list) Postconditions: returns small - the smallest number in values (float) large - the largest number in values (float) total - the total of the numbers in values (float) average - the average of numbers in values (float) ------------------------------------------------------- """
Sample results (text in italics is user input):
Number of rows: 4 Number of columns: 3 Low value: -100 High value: 100 0 1 2 0 7.715 6.522 23.359 1 79.955 -4.858 -71.112 2 49.249 -17.001 22.338 3 98.593 -28.473 -92.926 Smallest: -92.926 Largest: 98.593 Total: 73.362 Average: 6.114
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
