human
Check whether the given integers a , b , c and d are in proportion | Function that returns true if the given four integers are in proportion.
Array will consist of only four integers.
Sort the array.
Find the product of extremes and means.
If the products are equal.
Driver code"
Solution in Python:
 What is a code to check whether the given integers a , b , c and d are in proportion and the other steps required?
assistant
#Here is code to check whether the given integers a , b , c and d are in proportion and the other steps required.
 def inProportion ( arr ) :
	n = 4 ;
	arr . sort ( )
	extremes = arr [ 0 ] * arr [ 3 ] ;
	means = arr [ 1 ] * arr [ 2 ] ;
	if ( extremes == means ) :
		return True ;
	return False ;
if __name__ == " _ _ main _ _ " :
	arr = [ 1 , 2 , 4 , 2 ] ;
	if ( inProportion ( arr ) ) :
		print ( " Yes " ) ;
	else :
		print ( " No " ) ;