Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please use python to code Thank you so much Question 6: Write two versions of a program that reads a sequence of positive integers from
Please use python to code Thank you so much Question 6: Write two versions of a program that reads a sequence of positive integers from the user, calculates their geometric mean, and print the geometric mean. Note: In mathematics, geometric mean of a dataset [a, a2, as3 ..., an) is givern For example, the geometric mean of 2, 9 and 12 is equal to 6 (V2.9.12 6),. Your two versions of the program should read the integer sequence in two ways a) First read the length of the sequence For example, an execution would look like Please enter the length of the sequence: 3 Please enter your sequence: 1 The geometric mean is: 1.8171 b) Keep reading the numbers until 'done' is entered. For example, an execution would look like: Please enter a non-empty sequence of positive integers, each one in a separate line. End your sequence by typing done: done The geometric mean is: 1.8171
Please use python to code Thank you so much
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started