Sep-16-2018, 08:10 PM
(This post was last modified: Sep-16-2018, 08:16 PM by Metalman488.)
so I applied my eqSize function and the result I get from adding these two lists:
list1 = ["123", "001", "234", "567"]
list2 = ["007", "894", "561"]
is ['124', '009', '129', '128'] which is almost correct except the first element should be 123 not 124, and I have no clue why it's doing that. My best guess is that there is something wrong with my carryout.
All I had to do is add an else statement to the if statement that dealt with carryout in the add function:
list1 = ["123", "001", "234", "567"]
list2 = ["007", "894", "561"]
is ['124', '009', '129', '128'] which is almost correct except the first element should be 123 not 124, and I have no clue why it's doing that. My best guess is that there is something wrong with my carryout.
All I had to do is add an else statement to the if statement that dealt with carryout in the add function:
if(len(nStr) > ND): carryout = int(nStr[0]) n = int(nStr[1:]) else: carryout=0Sorry for all the mini reiplies. I guess I should try to figure it out more before I post.