1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
r-ruslan [8.4K]
3 years ago
12

Write a class called Person that has two data members - the person's name and age. It should have an init method that takes two

values and uses them to initialize the data members.Write a separate function (not part of the Person class) called std_dev that takes as a parameter a list of Person objects (only one parameter: person_list) and returns the standard deviation of all their ages (the population standard deviation that uses a denominator of N, not the sample standard deviation, which uses a different denominator).
Computers and Technology
1 answer:
umka21 [38]3 years ago
3 0

Answer:

class Person(object):

   def __init__(self, name, age):

       self.name = name

       self.age = age

 

def std_dev(person_list):

   average = 0

   for person in person_list:

       average += person.age

   average /= len(person_list)

   total = 0

   for person in person_list:

       total += (person.age - average) ** 2

   return (total / (len(person_list) )) ** 0.5

Explanation:

The class "Person" is a python program class defined to hold data of a person (name and age). The std_dev function accepts a list of Person class instances as an argument and returns the calculated standard deviation of the population.

You might be interested in
To lock down security settings on an individual system on a network, what would you use?
professor190 [17]

Answer:

The answer is "LSS(Local Security Settings)".

Explanation:

The LSS stands for Local Security Settings, it is a set of information about the security of a local computer. LSS allows a feature, that the information on the protection of a local computer is a local safety policy of a device.

  • This option is available on windows.
  • The local security policy information includes the domains, that trust login attempts to be authenticated.

 

8 0
4 years ago
What will be printed when the following code is executed? int y = 10; if ( y == 10) { int x = 30; x += y; } cout<<"x = ";
Alja [10]

Answer:

I don't know the answer

5 0
3 years ago
The rules that determine what is allowed in a program are known as the
Varvara68 [4.7K]
Syntax is like the grammar coding has, they have this so everything works in a certain manner 

6 0
4 years ago
Which describes the state of "weak" vs. "strong" Artificial Intelligence in the marketplace?
ollegr [7]
With strong AI, machines can actually think and carry out tasks on their own, just like humans do. With weak AI, the machines cannot do this on their own and rely heavily on human interference. ... They can process and make independent decisions, while weak AI-based machines can only simulate human behavior.
7 0
3 years ago
Read 2 more answers
If you saw the number BDB76B used to describe a color in a computer program, which number system is being used?
Pepsi [2]
The answer is
A

Hexadecimal
6 0
4 years ago
Other questions:
  • In which type of attack does the user respond to several external communication requests? Harry wants to watch a movie online by
    14·1 answer
  • A user calls to report that she is experiencing intermittent problems while accessing the wireless network from her laptop compu
    5·2 answers
  • Why do I keep losing my crown thingies (brainliest answers) and I lost 2 ranks in the last month? HOW? WHY? I'm starting to get
    12·2 answers
  • Match the item to the type.
    11·1 answer
  • Given the following method static void nPrint(String message, int n) { while (n > 0) { System.out.print(message); n--; } } Wh
    12·1 answer
  • IRQ 0 interrupt have _______________ priority<br> ? low<br> ? medium<br> ? highest<br> ? lowest
    13·1 answer
  • What is a scientific inquiry?
    9·1 answer
  • Which of the following is NOT a common slide layout?
    6·1 answer
  • 2. What are some other reasons why you might need to know the operating system version on your computer or mobile device
    14·1 answer
  • What variation pairs a new employee with an employee who has been with the company for 20 years?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!