human
Find Second largest element in an array | Function to print the second largest elements.
There should be atleast two elements.
If current element is smaller than first then update both first and second.
If arr [ i ] is in between first and second then update second.
Driver program to test above function"
Solution in Python:

Write me a code to find Second largest element in an array and the other steps required?
assistant
#Here is code to find Second largest element in an array and the other steps required.
 def print2largest ( arr , arr_size ) :
	if ( arr_size < 2 ) :
		print ( " ▁ Invalid ▁ Input ▁ " )
		return
	first = second = - 2147483648
	for i in range ( arr_size ) :
		if ( arr [ i ] > first ) :
			second = first
			first = arr [ i ]
		elif ( arr [ i ] > second and arr [ i ] != first ) :
			second = arr [ i ]
	if ( second == - 2147483648 ) :
		print ( " There ▁ is ▁ no ▁ second ▁ largest ▁ element " )
	else :
		print ( " The ▁ second ▁ largest ▁ element ▁ is " , second )
arr = [ 12 , 35 , 1 , 10 , 34 , 1 ]
n = len ( arr )
print2largest ( arr , n )