human
Smallest number whose set bits are maximum in a given range | Returns smallest number whose set bits are maximum in given range ..
driver code"
How can the above be solved in Python?

=====
Give me a code to smallest number whose set bits are maximum in a given range and the other steps required?
assistant
#Here is code to smallest number whose set bits are maximum in a given range and the other steps required.
 def countMaxSetBits ( left , right ) :
	while ( left | ( left + 1 ) ) <= right :
		left |= left + 1
	return left
l = 1
r = 5
print ( countMaxSetBits ( l , r ) )
l = 1
r = 10
print ( countMaxSetBits ( l , r ) )