Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
sample input:
123
13
4
sample output:
202


If the input is given in negative value print "Invalid input".

What I have tried:

a = input()
b = input()
c = input()
d = ((a+b),4)
print(d)
Posted
Updated 6-Feb-22 7:58am

1 solution

Use the int(string, base) function to translate input from a base n to internal binary, add them, then convert back to the appropriate base to display: Python int() Function[^]
 
Share this answer
 
Comments
CPallini 6-Feb-22 16:11pm    
5.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900