Manual
Convert an integer number to a binary string. The result is a valid Python expression. If x is not a Python int object, it has to define an__index__() method that returns an integer.
直译
将整数转换为二进制字符串。结果为有效的Python表达式。如果‘x’不是一个Python整数对象,就必须通过定义一个index()方法来返回一个整数。
实例
整数对象
>>> bin(338)
'0b101010010'
>>> bin(250)
'0b11111010'
非整数对象
>>> cl