Function that convert a decimal number into binary in Python

 



def d2b(decimalN):
    return bin(decimalN).replace("0b", "")

print(d2b(10))


# bonus: One liner ninja technique
print(bin(10)[2:])









Comments

Popular posts from this blog

Quotation marks to wrap an element in HTML

What is the difference between iostream and iostream.h in cpp?

The Basic Structure of a Full-Stack Web App