1# Python program to convert decimal to binary
2
3# Function to convert Decimal number
4# to Binary number
5def decimalToBinary(n):
6 return bin(n).replace("0b", "")
7
8# Driver code
9if __name__ == '__main__':
10 print(decimalToBinary(8))
11 print(decimalToBinary(18))
12 print(decimalToBinary(7))
13
14Output:
151000
161001