Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to convert decimal to binary

def decimalToBinary(n):
    return bin(n).replace("0b", "")
   
# Driver code
if __name__ == '__main__':
    print(decimalToBinary(8))
    print(decimalToBinary(18))
    print(decimalToBinary(7))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #convert #decimal #binary
ADD COMMENT
Topic
Name
6+3 =