human
Find Second largest element in an array | Function to print second largest elements.
There should be atleast two elements.
Find the largest element.
Find the second largest element.
Driver code"
Solution in Python:

What is 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 ;
	largest = second = - 2454635434 ;
	for i in range ( 0 , arr_size ) :
		largest = max ( largest , arr [ i ] ) ;
	for i in range ( 0 , arr_size ) :
		if ( arr [ i ] != largest ) :
			second = max ( second , arr [ i ] ) ;
	if ( second == - 2454635434 ) :
		print ( " There ▁ is ▁ no ▁ second ▁ " + " largest ▁ element " ) ;
	else :
		print ( " The ▁ second ▁ largest ▁ " +   " element is " , second ) ;
if __name__ == ' _ _ main _ _ ' :
	arr = [ 12 , 35 , 1 , 10 , 34 , 1 ] ;
	n = len ( arr ) ;
	print2largest ( arr , n ) ;