method over the formatting expression (see the related note ahead)'{: {: }format('spam' 'spam '{:> {:< }format('spam' spam 'platform:> {[kind]:< }format(sysdict(kind='laptop')win laptop floating-point numbers support the same type codes and formatting specificity in formatting method calls as in expressions for instancein the following { :gmeans the third argument formatted by default according to the "gfloating-point representation{ fdesignates the "ffloating-point format with just two decimal digitsand { : fadds field with width of six characters and zero padding on the left'{ : }{ }{ : }format( ' + + '{ : }{ }{ : }format( ' hexoctaland binary formats are supported by the format method as well in factstring formatting is an alternative to some of the built-in functions that format integers to given base'{ : }{ : }{ : }format( 'ff hexoctalbinary bin( )int(' ' ) (' ' other to/from binary hex( )int('ff' ) xff (' xff' other to/from hex oct( )int(' ' ) (' ' other to/from octalin prints and accepts formatting parameters can either be hardcoded in format strings or taken from the arguments list dynamically by nested format syntaxmuch like the syntax in formatting expressionswidth and precision'{ }format( ' ' ( ' parameters hardcoded '{ { } }format( ' '* ( ' take value from arguments string fundamentals ditto for expression ditto for expression