The bin() Function is a standard library function in Python. It converts an integer number to an equivalent binary number.
Python bin() Function Syntax
bin(x)
Parameter: It takes a single parameter x, which is an integer number whose binary equivalent we want to find out. If x is not a Python int object, it has to define an __index__() method that returns an integer.
Return value: This function returns a binary String equivalent to the given integer number.
Python bin() Function Example
In the following example, we are using bin() function to find out the binary equivalent of an integer number 10.
#integer number
num = 10
print('The binary equivalent of 10 is:', bin(num))
Output: