Question: Dafine a class named Person that has two private data members - the person's name and age - If should have an initializer method that
Dafine a class named Person that has two private data members the person's name and age If should have an initializer method that takes two values and uses them to initialize the data members. It should have a get age method that takes no parameters and returns the age.
Define a separate, toplevel function not part of the Person class called stddev that takes as a parameterallst of Person objects and returns the standard deviation of all their ages the population standard deviation that uses adenominator of N not the sample standard deviation, which uses a different denominator Here's an example of celculating the population standard deviation.
If the listis empty, then the function stddev function should return None.
Tocalculate the standard deviation, you'll need to take a square root, which you can do by just using an exponent of For exemple, the result of would be Python does have a specific sqrt function, but that involvesimporting a module, which we haven't covered yet.
Heresasimple example of how your class and function could be used:
Person
Person Mercedes
PersonBeatrice,
person
answer stodev#
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
