Python bin() Function

Returns the binary version of a number

Syntax

Python
bin(number)

Parameters

ParameterDescription
number Required. The string value to search for within the given string

Example

Python
print('15 in binary: ' + bin(15))

Output

15 in binary: 0b1111