uses dictionaries instead of keyword argumentsand doesn' allow quite as much flexibility for value sources (which may be an asset or liabilitydepending on your perspective)more on how the two techniques compare aheadsame via expression template '% % and %stemplate ('spam''ham''eggs''spamham and eggstemplate '%(motto) %(pork) and %(food)stemplate dict(motto='spam'pork='ham'food='eggs''spamham and eggsnote the use of dict(to make dictionary from keyword arguments hereintroduced in and covered in full in it' an often less-cluttered alternative to the literal naturallythe subject string in the format method call can also be literal that creates temporary stringand arbitrary object types can be substituted at targets much like the expression' % code'{motto}{ and {food}format( motto= food=[ ]' and [ ]just as with the expression and other string methodsformat creates and returns new string objectwhich can be printed immediately or saved for further work (recall that strings are immutableso format really must make new objectstring formatting is not just for displayx '{motto}{ and {food}format( motto= food=[ ] ' and [ ] split(and '[' ''[ ]' replace('and''but under no circumstances' ' but under no circumstances [ ]adding keysattributesand offsets like formatting expressionsformat calls can become more complex to support more advanced usage for instanceformat strings can name object attributes and dictionary keys--as in normal python syntaxsquare brackets name dictionary keys and dots denote object attributes of an item referenced by position or keyword the first of the following examples indexes dictionary on the key "spamand then fetches the attribute "platformfrom the already imported sys module object the second does the samebut names the objects by keyword instead of positionimport sys 'my { [kind]runs { platform}format(sys{'kind''laptop'}'my laptop runs win string formatting method calls