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]
2 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]2 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
7. Little Big Planet advanced the platforming genre of games by __________.
patriot [66]

Answer:

Explanation:

c because it will hook the person

5 0
3 years ago
Algorithm and flowchart:- find the product of two number (a and b)​
Korvikt [17]

Answer:

i have no idea a i guess

Explanation:

5 0
3 years ago
Read the sentence and answer the question. "Adam Cooper, a cultural strategy officer for the mayor of London, agrees. He thinks
siniylev [52]
<span>I think its pioneers!</span>
8 0
3 years ago
What is the best approach to testing a website
Ronch [10]

A vital part of any website project is the quality assurance stage. Prior to launch, final QA testing ensures that your site is working according to your expectations and that your site users won’t be frustrated with any non-functioning pages.

7 0
3 years ago
What file name would allow you to easily find and edit your document later in Word Online?
DIA [1.3K]
The first one “ jane_essay 2_24_21 “
6 0
2 years ago
Read 2 more answers
Other questions:
  • Assume that x is a double variable that has been initialized. Write a statement that prints it out, guaranteed to have a decimal
    5·1 answer
  • What are some of the challenges that could arise from setting up a file management system on a computer?
    11·1 answer
  • Create a detail report that will display all SCR courses in alphabetical order, with the course name and the instructor name in
    5·1 answer
  • Hosts A and B are communicating over a TCP connection, and Host B has already received from A all bytes up through byte 126. Sup
    10·1 answer
  • On a Windows network share, if the user can add, edit, and delete files and folders within the LabFiles folder, what type of acc
    14·1 answer
  • How do airbags prevent injury?
    13·1 answer
  • a marketing company is setting up a new office in the city. which type of contract should they sign for periodic maintenance of
    15·1 answer
  • Need answer ASAP. I’ll mark brainliest if correct
    7·1 answer
  • 6. kinukuha nito ang kabuuang bilang ng mga numerical na datos sa mga piniling cells
    12·1 answer
  • Discussion Topic
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!