Check if temp < 10
if ( temp < 10 ) : NEW_LINE INDENT hexaDeciNum [ i ] = chr ( temp + 48 ) NEW_LINE i = i + 1 NEW_LINE DEDENT else : NEW_LINE INDENT hexaDeciNum [ i ] = chr ( temp + 55 ) NEW_LINE i = i + 1 NEW_LINE DEDENT n = int ( n / 16 ) NEW_LINE hexCode = " " NEW_LINE if ( i == 2 ) : NEW_LINE hexCode = hexCode + hexaDeciNum [ 0 ] NEW_LINE hexCode = hexCode + hexaDeciNum [ 1 ] NEW_LINE elif ( i == 1 ) : NEW_LINE hexCode = "0" NEW_LINE hexCode = hexCode + hexaDeciNum [ 0 ] NEW_LINE elif ( i == 0 ) : NEW_LINE hexCode = "00" NEW_LINE