Python program to find the geometric mean of n numbers
Python program to find the geometric mean of n numbers
c = 0
p = 1.0
count = int(input("Enter the number of values: "))
while(c<count):
x = float(input("Enter a real number: "))
c = c+1
p = p * x
gm = pow(p,1.0/count)
print("The geometric mean is: ",gm)
Comments
Post a Comment