Question: 11) Idea: Define a function to compute a decimal number. # Define a function average to compute the average value of a list # of
11) Idea: Define a function to compute a decimal number.
# Define a function average to compute the average value of a list # of decimal numbers. # Given a list of decimal numbers, it returns the average of # the numbers.
# Your function must work with both of these test cases. weight_list = [91.2, 178.5, 220, 121.5]
ave_weight = average(weight_list)
print(ave_weight, type(ave_weight)) # type should be float
distance_list = [100.1, 65.7, 5000.79]
average_distance = average(distance_list)
print(average_distance, type(average_distance)) # type should be float
Using Python programming
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
