Skip to content

Home

Number to binary

Returns the binary representation of the given number.

def to_binary(n):
  return bin(n)

to_binary(100) # 0b1100100

More like this

Start typing a keyphrase to see matching snippets.