Question: Can you add in comments to the coding lines so that i can understand what it is about? 1e def to string(list): 2 my_str m
Can you add in comments to the coding lines so that i can understand what it is about?

1e def to string(list): 2 my_str m for x in list: if int(x) else: mystr += 4 >-10; s-str(int(int (x)/10)) +"str(int (int(x)810)) " " + str(x s - return my_str 11e def to string with_carry(list): 12 my str- for x in list: 14 15 16 else: S str(x) 18 19 my str += s return my_str 21e def printQ (num1, num2,result,carries): print(" "+to-string-with-carry(carries)) print(" "+to_string(numl)) print(+" to_string(num2)) print("-") 24 25 26 if(int(result[0])-10) 27 28 29 print to string(result)) else: print( "+to string(result)) 31e def add (num1, num2): result- [] 34 35 carry0 carries-[ for x in range (2,-1,-1): sum = carry + int (num![x]) if sum >= 10 and int (num2 [x] + x != 0: 37 38 39 40 carryisum 10 carries.insert(0,int(carry)) remain = sum%10 result.insert (0,int (remain)) else: 43 carries.insert(0,0) carry 0 result.insert (0, int (isum)) 45 printQ(num1, num2,result,carries) 49 def main func): 50 while 1: num1 = input("Input 1st set three numeral: ") num2 input( "Input 2nd set three numeral: ") tnum1 list(num1) tnum2 list(num2) if len(tnum!) != 3 or len(tnum2) != 3: 53 54 print( "Only 3 numeral accepted") else: add (tnum1, tnum2) break 58 60 main func()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
