human
Program for Mean Absolute Deviation | Function to find mean of the array elements ..
Calculate sum of all elements ..
Function to find mean absolute deviation of given elements ..
Calculate the sum of absolute deviation about mean ..
Return mean absolute deviation about mean ..
Driver function ."
Solution in Python:
assistant
#Here is code to program for Mean Absolute Deviation and the other steps required.
 def Mean ( arr , n ) :
	sm = 0
	for i in range ( 0 , n ) :
		sm = sm + arr [ i ]
	return sm // n
def meanAbsoluteDeviation ( arr , n ) :
	absSum = 0
	for i in range ( 0 , n ) :
		absSum = absSum + abs ( arr [ i ] - Mean ( arr , n ) )
	return absSum / n
arr = [ 10 , 15 , 15 , 17 , 18 , 21 ]
n = len ( arr )
print ( meanAbsoluteDeviation ( arr , n ) )