human
Count of numbers in range [ L , R ] with LSB as 0 in their Binary representation | Function to return the count of required numbers.
If rightmost bit is 0.
Return the required count.
Driver code.
Call function countNumbers"
How can the above be solved in Python?
 Give me a code to count of numbers in range [ L , R ] with LSB as 0 in their Binary representation and the other steps required?
assistant
#Here is code to count of numbers in range [ L , R ] with LSB as 0 in their Binary representation and the other steps required.
 def countNumbers ( l , r ) :
	count = 0
	for i in range ( l , r + 1 ) :
		if ( ( i & 1 ) == 0 ) :
			count += 1
	return count
l = 10
r = 20
print ( countNumbers ( l , r ) )