You are here : python_3Built-in Functionsbin

bin() - Built-in Functions

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.


Syntax

bin(x)


Example


Output / Return Value


Limitations


Alternatives / See Also


Reference