15,851,319 members
See more:
Sample input:
123
13
4

Sample output:
202

What I have tried:

Python
```a = int(input())
b = int(input())
c = int(input())
len_a = len(a)
len_b = len(b)
s = ''
diff = abs((len_a-len_b))
for i in range(1,diff+1):
s+='0'
if len_a<len_b:
a = s+a
else:
b = s+b```
Posted
Updated 7-Feb-22 6:54am
v2

## Solution 1

Once you have the integer values you can simply add them together to get the total. This holds true for any number.

The key to your question is how to display them in the correct format. You need to use the base number to calculate each digit of the string. This is done by taking the remainder of the number divided by the base repeatedly, until you have used up all the number. You then need to order those numbers correctly before displaying them. Taking your numbers above:
```123 + 13 = 136
136 / 4 = 34 remainder 0
34 / 4  =  8 remainder 2
8 / 4   =  2 remainder 0
2 / 4   =  0 remainder 2
So the final display is: 2020 base 4```

Oops I misread the question. In order to get the values in a specific base to start with, you need to convert each successive digit. So do not input them directly as `int` types, but read them as a string. Start with a sum variable set to zero. You then take each character and convert it to an `int`. Then multiply the sum by the base and add the integer value to it. Repeat that for each digit in the string. You can then add the two numbers together and display them as described above.

v4

## Solution 2

This is the same question you asked yesterday: Add two numbers given in base n format in python.[^]
And since I told you exactly what to do then and you've ignored it, there is no point at all in asking it again.

If I was you, I'd spend the five or ten minutes it would take you to write the code yourself instead of trying to get other people to do it for you: your homework "hand in" deadline must be getting close ...