human
Count of carry operations on adding two Binary numbers | Function to count the number of carry operations to add two binary numbers.
To Store the carry count.
Iterate till there is no carry.
Carry now contains common set bits of x and y.
Sum of bits of x and y where at least one of the bits is not set.
Carry is shifted by one so that adding it to x gives the required sum.
Adding number of 1 's of  carry to final count.
Return the final count.
Given two numbers.
Function call"
How can the above be solved in Python?
 ... Write me a code to count of carry operations on adding two Binary numbers and the other steps required?
assistant
#Here is code to count of carry operations on adding two Binary numbers and the other steps required.
 def carryCount ( num1 , num2 ) :
	count = 0
	while ( num2 != 0 ) :
		carry = num1 & num2
		num1 = num1 ^ num2
		num2 = carry << 1
		count += bin ( num2 ) . count ( '1' )
	return count
A = 15
B = 10
print ( carryCount ( A , B ) )