Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Python bin() Function

Python bin() Function

Python built-in function Python built-in 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

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 Python built-in function