- Oct 21, 2021
I was trying to convert Decimal to Binary, there is no error in the code but while executing I am getting blank, not showing anything. Could someone help me figure out where is the mistake?
I have read this article to understand the concept and tried this.
def decimalToBinary(ip_val): if ip_val= 1: # recursive function call decimalToBinary(ip_val // 2) # printing remainder from each function call print(ip_val % 2, end = '') # Driver Code if __name__ == '__main__': # decimal value ip_val = 24 # Calling special function decimalToBinary(ip_val)