Question: please use python c) (10 points) You have a class Averagerult calculates the average of the numbers you start providing to it. The example of

 please use python c) (10 points) You have a class Averagerult

please use python

c) (10 points) You have a class Averagerult calculates the average of the numbers you start providing to it. The example of use of this class and its corresponding output is shown after the definition of class. class Averager: def init (self): self count 0 self. total 0 = def add (self, value) : self. total += value self. count += 1 return selfie total / self-count You can use this class as follows a = Averager() azadd (10) Qupt: 10.0 azadd (20) Output: 15.0 azadd (30) Output: 20.0 You will define a closure which will calculate average as done by the Averager class

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!