human
Check in binary array the number represented by a subarray is odd or even | Prints if subarray is even or odd.
if arr [ r ] = 1 print odd.
if arr [ r ] = 0 print even.
Driver code"
How can the above be solved in Python?
 What is a code to check in binary array the number represented by a subarray is odd or even and the other steps required?
assistant
#Here is code to check in binary array the number represented by a subarray is odd or even and the other steps required.
 def checkEVENodd ( arr , n , l , r ) :
	if ( arr [ r ] == 1 ) :
		print ( " odd " )
	else :
		print ( " even " )
arr = [ 1 , 1 , 0 , 1 ]
n = len ( arr )
checkEVENodd ( arr , n , 1 , 3 )