+ 1
How to convert 2 type of biner
input : (first biner) (second biner) output : a new string that is sum of both biner input : 1111111111111111 1010 output : 10000000000001001
1 ответ
+ 8
Try like this:
a = int(input("First binary number: "), 2)
b = int(input("Second binary number: "), 2)
print("Outcome (in a binary format): ", bin(a+b))
print("Which translates into: {}+{}={}".format(a, b, a+b))
https://code.sololearn.com/cYGrNro5F0rG/?ref=app