1、str.format() 格式化数字的多种方法:参考:https://www.jianshu.com/p/1a0f8e60ed58 '{0:b}'.format(int(a,2)+int(b,2))意思就是 按照(2进制a) + (2进制b)的格式 输出 1、str.format() 格式化数字的多种方法: