Python bin() Function
Description
bin() Returns the binary representation of an integer int or a long integer long int.
Syntax
The syntax of the bin() method is as follows:
bin(x)
Parameters
- x -- an int or long int number
Return Value
The string.
Example
The following examples show the use of the bin function:
bin
(
10
)
'
0b1010
'
bin
(
20
)
'
0b10100
'
Python built-in function