human
Find Surpasser Count of each element in array | Function to find surpasser count of each element in array.
stores surpasser count for element arr [ i ].
Function to print an array.
Driver program to test above functions"
How can the above be solved in Python?
assistant
#Here is code to find Surpasser Count of each element in array and the other steps required.
 def findSurpasser ( arr , n ) :
	for i in range ( 0 , n ) :
		count = 0 ;
		for j in range ( i + 1 , n ) :
			if ( arr [ j ] > arr [ i ] ) :
				count += 1
		print ( count , end = " ▁ " )
def printArray ( arr , n ) :
	for i in range ( 0 , n ) :
		print ( arr [ i ] , end = " ▁ " )
arr = [ 2 , 7 , 5 , 3 , 0 , 8 , 1 ]
n = len ( arr )
print ( " Given ▁ array ▁ is " )
printArray ( arr , n )
print ( " Surpasser Count of array is " ) ;
findSurpasser ( arr , n )