Conversion Meaning Notes 'd' Signed integer decimal. 'i' Signed integer decimal. 'o' Signed octal value. (1) 'u' Obselete type – it is identical to 'd'. (7) 'x' Signed hexadecimal (lowercase). (2) 'X' Signed hexadecimal (uppercase). (2) 'e' Floating point exponential format (lowercase). (3) 'E' Floating point exponential format (uppercase). (3) 'f' Floating point decimal format. (3) 'F' Floating point decimal format. (3) 'g' Floating point format. Uses lowercase exponential format if exponent is less than -4 or not less than precision, decimal format otherwise. (4) 'G' Floating point format. Uses uppercase exponential format if exponent is less than -4 or not less than precision, decimal format otherwise. (4) 'c' Single character (accepts integer or single character string). 'r' String (converts any python object using repr()). (5) 's' String (converts any python object using str()). (6) '%' No argument is converted, results in a '%' character in the result. Notes: The conversion flag characters are: Flag Meaning '#' The value conversion will use the “alternate form” (where defined below). '0' The conversion will be zero padded for numeric values. '-' The converted value is left adjusted (overrides the '0' conversion if both are given). ' ' (a space) A blank should be left before a positive number (or empty string) produced by a signed conversion. '+' A sign character ('+' or '-') will precede the conversion (overrides a “space” flag). Format C Type Python Notes x pad byte no value c char string of length 1 b signed char integer B unsigned char integer ? _Bool bool (1) h short integer H unsigned short integer i int integer I unsigned int integer or long l long integer L unsigned long long q long long long (2) Q unsigned long long long (2) f float float d double float s char[] string p char[] string P void * long Notes: