Program to convert Hexa | Function to convert Haxadecimal to BCD ; Iterating through the digits ; Conversion into equivalent BCD ; Driver code ; Function call
def HexaDecimaltoBCD ( str ) : NEW_LINE INDENT for i in range ( len ( str ) ) : NEW_LINE INDENT print ( " { 0:04b } " . format ( int ( str [ i ] , 16 ) ) , end = " ▁ " ) NEW_LINE DEDENT DEDENT str = "11F " NEW_LINE HexaDecimaltoBCD ( str ) NEW_LINE