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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started