Question: PLE HELP ME BY PYTHON Part 1: Statistical Functions In this part of the assignment, you will write four functions. The first function calculates the

 PLE HELP ME BY PYTHON Part 1: Statistical Functions In this

PLE HELP ME BY PYTHON

Part 1: Statistical Functions In this part of the assignment, you will write four functions. The first function calculates the reciprocal of a number, which is defined as 1umber. So, for example, the reciprocal of 8 is 1/8, or 0.125. The reciprocal of 2.5 is 1/2.5 or 0.4. You must name the function reciprocal and it takes one parameter. It returns the input parameter's reciprocal. Don't worry about what happens if someone gives a zero as input: they get what they deserve (a divide by zero" error). For the other functions: You are probably familiar with the arithmetic mean; it's also called the average. There are other types of means. There's the geometric mean and the very seldom-used harmonic mean. In this program you will write three functions to calculate each of these means for three numbers. Here are the formulas: a+b+c arithmetic mean=- geometric mean=va.b.c harmonic mean=- 1.1.1 + +- - a - b c Name your functions ran()).geometric_nean() and harmonic_mean() Each of these functions has three parameters. The harmonic_nean() function must use the reciprocal function. Just like reciprocall.don't worry about division by zero. Hint: If you're feeling bold, the harmonic mean is mathematically equivalent to the reciprocal of the arithmetic mean of the reciprocals of the input parameters. This makes the function very short to write! Start with the rathfunctions test.py, program and write your four functions at the top of that file. You may have to import Tath. Then run the program to make sure that it gives the desired results. Name your program in the form lastname_firstname_stats.py Note: in the test program, the geometric means should come out to exactly 12 and 8.4, but floating point is never exact, so you will get answers like 11.999... and 8.3999_

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!