Question: Problem 3. (Geometric and Harmonic Means) Write a program means.py that reads in positive real numbers from standard input and writes their geometric and harmonic

Problem 3. (Geometric and Harmonic Means) Write a program means.py that reads in positive real numbers from standard input and writes their geometric and harmonic mleans. The geometric mean o n positive numbers x1,x2, ,xn is x1 22 xn)1 and their harmonic mean is n/Q/A + 1/T2 + . . . + 1/Zn). Hint: for the geometric mean, consider taking logarithms to avoid overflow; if y (a x bx c)1/d, then Iny (1/d)(Ina InbInc) (say), and y e" s Python3 means.py 1.0 2.0 3.0 4.0 5.0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
