String Formatting

  • + 1 comment

    The hexadecimal portion must be in uppercase if it contains letter(s). So try:

    he_ = str(hex(num)).replace('0x','').upper()