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
TRUE OR FALSE: Individuals involved in surveillance prior to a terrorist attack are always well-trained and equipped.
eduard
I would say false for sure
5 0
3 years ago
What are smart mobile devices?
Mashutka [201]
Do you mean like a phone

IPhones
Samsung
Moto z
Lge sorry if this isn't what you asked
7 0
3 years ago
Read 2 more answers
A company asked you help mitigate the brute force attacks carried out against its users' Windows account passwords. You successf
alexdok [17]

Answer:

a. Require user account passwords

e. Set failed logon restrictions

b. Require strong passwords

Explanation:

3 0
3 years ago
Will technology be the destruction or salvation of human-kind
Delicious77 [7]

MARK ME As BRAINLIEST

Answer is salvation
5 0
3 years ago
Read 2 more answers
Suppose we can buy a chocolate bar from the vending machine for $1 each. Inside every chocolate bar is a coupon. We can redeem s
Tanya [424]

Answer and Explanation:

Using JavaScript:

/* program should take N input which represents the dollar amount and output how many chocolate bars and how many coupons we have*/

function chocolatebar(dollars){

var dollaramt= dollars;

var i;

for(i=0; i <= dollaramt; i++){

i=i+6

?

Alert ("you have 1 extra chocolate bar");

:

Alert ("keep buying chocolate bars to get more coupons for a bonus chocolate bar")

}

}

*

7 0
3 years ago
Other questions:
  • Tara referred to various information sources while writing her research paper. How can she acknowledge these sources in her docu
    8·1 answer
  • HELP PLEASE
    5·1 answer
  • What is a parameter variable?
    8·1 answer
  • Which of the following is true of Chinese Opera: Two opera centers emerged Beijing and Yangzhou 300-400 forms of opera arose in
    10·1 answer
  • . List 5 types of exploits from cybercrime and provide brief definition. (2.5 Marks)
    5·1 answer
  • When a hoverboard's battery dies, does the hoverboard battery life get impacted the next time the battery is full?
    12·1 answer
  • Which of the following activities does an effective team do?
    15·2 answers
  • Cindy tried to delete a customer but the customer still had open invoices so the system would not allow her to delete the custom
    11·1 answer
  • Please list 15 safety rules that you think should be practiced in the Computer Technology classroom/lab.
    12·1 answer
  • Kinda strange, and im good
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!