human
Count subarrays having even Bitwise OR | Function to count the number of subarrays having even Bitwise OR.
Store number of subarrays having even bitwise OR.
Store the length of the current subarray having even numbers.
Traverse the array.
If the element is even.
Increment size of the current continuous sequence of even array elements.
If arr [ i ] is odd.
If length is non zero.
Adding contribution of subarrays consisting only of even numbers.
Make length of subarray as 0.
Add contribution of previous subarray.
Return total count of subarrays.
Driver Code.
Function Call"
Solution in Python:

Give me a code to count subarrays having even Bitwise OR and the other steps required?
assistant
#Here is code to count subarrays having even Bitwise OR and the other steps required.
 def bitOr ( arr , N ) :
	count = 0
	length = 0
	for i in range ( N ) :
		if ( arr [ i ] % 2 == 0 ) :
			length += 1
		else :
			if ( length != 0 ) :
				count += ( ( length ) * ( length + 1 ) ) // 2
			length = 0
	count += ( ( length ) * ( length + 1 ) ) // 2
	return count
if __name__ == ' _ _ main _ _ ' :
	arr = [ 1 , 5 , 4 , 2 , 6 ]
	N = len ( arr )
	print ( bitOr ( arr , N ) )