human
Program for harmonic mean of numbers | Function that returns harmonic mean ..
Driver code"
Solution in Python:
assistant
#Here is code to program for harmonic mean of numbers and the other steps required.
 def harmonicMean ( arr , freq , n ) :
	sm = 0
	frequency_sum = 0
	for i in range ( 0 , n ) :
		sm = sm + freq [ i ] / arr [ i ]
		frequency_sum = frequency_sum + freq [ i ]
	return ( round ( frequency_sum / sm , 4 ) )
num = [ 13 , 14 , 15 , 16 , 17 ]
freq = [ 2 , 5 , 13 , 7 , 3 ]
n = len ( num )
print ( harmonicMean ( num , freq , n ) )