Conversion Type Meaning
d, i Signed integer decimal
o Unsigned octal
u Unsigned decimal
x Unsigned hexadecimal (lowercase)
X Unsigned hexadecimal (uppercase)
e Floating point exponential format (lowercase)
E Floating point exponential format (uppercase)
f, F Floating point decimal format
g Same as e if exponent is greater than –4 or less than precision, f otherwise
G Same as E if exponent is greater than –4 or less than precision, F otherwise
c Single character (accepts integer or single character string)
r String (converts any Python object using repr)
|