如何在 Python 中将整数转换为二进制字符串?
37 → '100101'
Python 的字符串格式方法可以采用格式规范。
>>> "{0:b}".format(37) '100101'
Python 2 的格式规范文档
Python 3 的格式规范文档