The syntax for using the format operator is as follows : Format : String PYTHON TUTORIALS


PYTHON TUTORIALS » String » Format »

 

The syntax for using the format operator is as follows


Format Symbol  Conversion
%c              Character (integer [ASCII valueor string of length 1)
%r              String conversion via repr() prior to formatting
%s              String conversion via str() prior to formatting
%d / %i          Signed decimal integer
%u              Unsigned decimal integer
%o              (Unsignedoctal integer
%x/ %X          (Unsignedhexadecimal integer (lower/UPPERcase letters)
%e / %E         Exponential notation (with lowercase 'e'/UPPERcase 'E')
%f / %F         Floating point real number (fraction truncates naturally)
%g / %G         The shorter of %e and %f/%E% and %F%
%%              Percent character unescaped



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo String
» Format