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
A company that manufactures machine parts orders a new system that makes products at ten times the speed of the earlier machine.
patriot [66]
Autonomic computing???????????????????????????????
7 0
3 years ago
If you tap or click the increase font size button too many times and make the font size too big, you can tap or click the _____
ioda
You can click the ctrl and minus  button at the same time
7 0
3 years ago
A factory producing cables for personal computers finds that its current average
puteri [66]
This is normal as personal computers, unless designed to, don't usually put out a ton of power it's mostly just what your battery need and a bit more that's it
8 0
3 years ago
A simple way to think of the Excel application is as a giant ______.
Naddik [55]
Spreadsheet ......zzzzzz
8 0
2 years ago
Read 2 more answers
When you send an email how many computers does it go to
Xelga [282]

once you have sent the email it will only go to the server which then the person receiving it would log on therefore requesting the emails recived.

I'm not 100% sure my answer is classed as correct but I would say it doesn't go to a computer it just gets stored on a server in till requested

4 0
2 years ago
Other questions:
  • Which computer port transmits audio and video without the need for compression?
    6·1 answer
  • How is kerning used in Word?
    7·2 answers
  • Solve a single producer, single consumer problem using wait() and notifyAll(). The producer must not overflow the shared buffer,
    5·1 answer
  • You should always assign the Needs Met rating before assigning the Page Quality rating, T or F ?
    6·2 answers
  • In addition to ranking the relevance of a particular site according to the keywords entered by the user, which of the following
    10·1 answer
  • Consider the following method:
    14·1 answer
  • Electronic mail is best used to:
    5·2 answers
  • Some one help pls will mark brainless !!!!!
    13·1 answer
  • How will you maintain electrical tools and equipment?
    12·2 answers
  • A computer is the __________ of an attack when it is used to conduct an attack against another computer.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!