Write a Python function to Convert Decimal to Binary


Topic: Write a Python function to Convert Decimal to Binary

Solution

def convertToBinary(n):
   if n > 1:
       convertToBinary(n//2)
   print(n % 2,end = '')



List all Python Programs