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

Making GUI Calculator in Tkinter Python

Unlocking Web Design: A Guide to Mastering CSS Layout Modes