human
Count of pairs ( x , y ) in an array such that x < y | Function to return the number of pairs ( x , y ) such that x < y.
To store the number of valid pairs.
If a valid pair is found.
Return the count of valid pairs.
Driver code"
How can the above be solved in Python?

Write me a code to count of pairs ( x , y ) in an array such that x < y and the other steps required?
assistant
#Here is code to count of pairs ( x , y ) in an array such that x < y and the other steps required.
 def getPairs ( a ) :
	count = 0
	for i in range ( len ( a ) ) :
		for j in range ( len ( a ) ) :
			if ( a [ i ] < a [ j ] ) :
				count += 1
	return count
if __name__ == " _ _ main _ _ " :
	a = [ 2 , 4 , 3 , 1 ]
	print ( getPairs ( a ) )