human
Number of mismatching bits in the binary representation of two integers | compute number of different bits.
since , the numbers are less than 2 ^ 31 run the loop from '0' to '31' only.
right shift both the numbers by ' i ' and check if the bit at the 0 th position is different.
Driver code.
find number of different bits"
How can the above be solved in Python?
 ... What is a code to number of mismatching bits in the binary representation of two integers and the other steps required?
assistant
#Here is code to number of mismatching bits in the binary representation of two integers and the other steps required.
 def solve ( A , B ) :
	count = 0
	for i in range ( 0 , 32 ) :
		if ( ( ( A >> i ) & 1 ) != ( ( B >> i ) & 1 ) ) :
			count = count + 1
	print ( " Number ▁ of ▁ different ▁ bits ▁ : " , count )
A = 12
B = 15
solve ( A , B )