Question: 1 9 . Implement avg Now that you have fixed the header for avg, it is time to implement the function. Again, pay close attention
Implement avg
Now that you have fixed the header for avg, it is time to implement the function. Again, pay close attention to the specification. When you have implemented the function, test your answer with the test script. You should pass all tests for now
def avgargs:
Returns average of all of arguments passed via tuple expansion
Remember that the average of a list of arguments is the sum of all of the elements
divided by the number of elements.
Examples:
avg returns
avg returns
Parameter args: the function arguments
Precondition: args are all numbers int or float
if lenargs:
return
total sumargs
denom lenargs
average totaldenom
return avg
I am getting an error saying the call avg returns not I am not sure why.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
