human
Number formed by deleting digits such that sum of the digits becomes even and the number odd | Function to convert a number into odd number such that digit - sum is odd.
Loop to find any first two odd number such that their sum is even and number is odd.
Print the result.
Driver Code"
How can the above be solved in Python?
assistant
#Here is code to number formed by deleting digits such that sum of the digits becomes even and the number odd and the other steps required.
 def converthenumber ( n ) :
	s = str ( n ) ;
	res = " " ;
	for i in range ( len ( s ) ) :
		if ( s [ i ] == '1' or s [ i ] == '3' or s [ i ] == '5' or s [ i ] == '7' or s [ i ] == '9' ) :
			res += s [ i ] ;
		if ( len ( res ) == 2 ) :
			break ;
	if ( len ( res ) == 2 ) :
		print ( res ) ;
	else :
		print ( " - 1" ) ;
if __name__ == " _ _ main _ _ " :
	n = 18720 ;
	converthenumber ( n ) ;