right shift both the numbers by ' i ' and check if the bit at the 0 th position is different
if ( ( ( A >> i ) & 1 ) != ( ( B >> i ) & 1 ) ) : NEW_LINE INDENT count = count + 1 NEW_LINE DEDENT print ( " Number ▁ of ▁ different ▁ bits ▁ : " , count ) NEW_LINE