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
Which processor is better for madvr
nadya68 [22]

Answer:

The i5.

Explanation:

It has a lower clock speed, but you do note that you have more cores, same with the cache memory.

8 0
4 years ago
What is the opportunity cost of computers when moving from point A to point B? -15 DVDs b. What is the opportunity cost of compu
oee [108]

Answer:

Increasing

Explanation:

Generally in economics, opportunity cost is the benefit that a person, a business, or an investor forgo or missed when he chooses one alternative instead of the other.

Under production, opportunity cost occurs when a producer sacrifice the production of one for the production of another good. Using good X and Y as examples, opportunity cost is measured by the number of units of good Y that the producer gives up in order to produce one or more units of good X.

In the question, the two products used are computers and DVD. The -15, -18 and -20 implies that producing an extra unit of computer by moving from point A to point B, point B to C, and point C to D, 15, 18 and 20 units of DVD respectively have to be given up.

Since 20 is greater than 18 and 18 is also greater than 15, it therefore implies as we produce more computers, the opportunity cost, which are the number of DVDs given up at each point, are increasing.

I wish you the best.

5 0
3 years ago
Why do we use console.log in javascript when changing variables?
Fiesta28 [93]
It helps to debug the code. Instead of going through every line of code to find an error, using console.log can tell us where to look.
8 0
3 years ago
Read 2 more answers
Business application software programs make it possible to
Daniel [21]
Business application software programs make it possible to: increase productivity in the office setting.
Please give me Brainless if this help!!
6 0
3 years ago
Q a z w s x e d c r f v​
Klio2033 [76]

Answer:

wdym

Explanation:

8 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following represent typical account fees?
    7·1 answer
  • Consolidating a system's physical and time resources is known as ________________.
    13·1 answer
  • Which notification appears on the screen when a new Outlook item arrives?
    10·1 answer
  • What function should be entered into B7 to calculate the total budget
    15·2 answers
  • "3. 4. Simple number search We will pass you 2 inputs an list of numbers a number, N, to look for Your job is to loop through th
    5·1 answer
  • How do you access the Control Panel?
    7·1 answer
  • The writers that most likely influenced our Founding Fathers were _____. Select all that apply. Swift and Bacon Marlowe and Kant
    14·2 answers
  • Write a program that takes two decimal numbers as input and print the largest. If the numbers are equal, print one of them.
    13·1 answer
  • What is the current situation in farming​
    13·2 answers
  • Why is a Quality assurance tester needed on a software development team?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!