I am trying to make a program that can add by literally counting. But for that I have 2 for
loops which need to work together. for example if I input 3 and 2 the outside for
loop iterates till "3" in the array and then another for loop iterates on the array till "2" in such a way that the outside for loop should(but doesn't) iterate with it and the position it is at eventually is printed out(which should be 5). How can I achieve this? because right now the inside loop will finish its iteration and break.
arr = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
#print(arr[0])
a = str(input()) #first number
b = str(input()) #second number
for i in arr:
if i == a:
for j in arr:
if j == b:
print(i)
break
this program outputs 3 for input 3 and 2 but I want 5