human
Addition of two numbers without propagating Carry | Function to prsum of 2 numbers without propagating carry.
Reverse a.
Reverse b.
Generate sum Since length of both a and b are same , take any one of them ..
Extract digits from a and b and add.
If sum is single digit.
If sum is not single digit reverse sum.
Extract digits from sum and append to result.
Driver code"
How can the above be solved in Python?
 ... What is a code to addition of two numbers without propagating Carry and the other steps required?
assistant
#Here is code to addition of two numbers without propagating Carry and the other steps required.
 def printSum ( a , b ) :
	res , temp1 , temp2 = 0 , 0 , 0
	while a > 0 :
		temp1 = temp1 * 10 + ( a % 10 )
		a //= 10
	a = temp1
	while b > 0 :
		temp2 = temp2 * 10 + ( b % 10 )
		b //= 10
	b = temp2
	while a :
		Sum = a % 10 + b % 10
		if Sum // 10 == 0 :
			res = res * 10 + Sum
		else :
			temp1 = 0
			while Sum > 0 :
				temp1 = temp1 * 10 + ( Sum % 10 )
				Sum //= 10
			Sum = temp1
			while Sum > 0 :
				res = res * 10 + ( Sum % 10 )
				Sum //= 10
		a //= 10
		b //= 10
	return res
if __name__ == " _ _ main _ _ " :
	a , b = 7752 , 8834
	print ( printSum ( a , b ) )