demo_string_placeholder21.py:
#Use "X" to convert the number into upper-case Hex format: txt = "The Hexadecimal version of {0} is {0:X}" print(txt.format(255))
➜ begtut>python demo_string_placeholder21.py
The Hexadecimal version of 255 is FF