Converts an integer into its binary equivalent string.
Syntax
bin(integer)
Example 1
Use bin()
function to return the binary equivalent of the integer 1
:
print(bin(1))
Example 2
Use bin()
to return the binary equivalent of the integer 100
:
Code Output