二进制求和 力扣76题—python 输入: a = “11”, b = “1” 输出: “100” def jinzhi(a,b): sum = int(a,2)+int(b,2) # 二进制转化为十进制再求和 print(sum) # 打印求和的结构(十进制的) sum = str(sum) # 将其转化为字符串 return bin(int(sum,10)) # 将其返回二进制 a = ‘1010’ b = ‘1011’ print(jinzhi(a,b)[2:]) “10101”