How To Print Capitalized Hexadecimal In Python, upper () method to convert … Use the format () function with a '02x' format.