for i in range(length-1, -1, -1): sum = int(a[i]) + int(b[i]) + carry if sum >= 2: carry = 1 sum -= 2 else: carry = 0 result = str(sum) + result # If there's still a carry after iterating through all the digits, add it to the beginning of the result if carry == 1: result = "1" + result return result how is this ?