modifier example number % %- %+ % % (name%(name) description put the value in field width of put the value in field characters wideleft-justified put the value in field characters wideright-justified put the value in field characters widefill in with leading zeros put the value in field characters wide with characters to the right of the decimal point get the value from the supplied dictionary using name as the key table additional formatting options modifier to specify the name of the key price item "bananaprint("the % costs % cents"%(item,price)the banana costs cents print("the %+ costs % cents"%(item,price)the banana costs cents print("the %+ costs % cents"%(item,price)the banana costs cents item_dict {"item":"banana","cost": print("the %(item) costs %(cost) cents"%item_dictthe banana costs cents in addition to format strings that use format characters and format modifierspython strings also include format method that can be used in conjunction with new formatter class to implement complex string formatting more about these features can be found in the python library reference manual control structures as we noted earlieralgorithms require two important control structuresiteration and selection both of these are supported by python in various forms the programmer can choose the statement that is most useful for the given circumstance for iterationpython provides standard while statement and very powerful for statement the while statement repeats body of code as long as condition is true for examplecounter while counter < print("helloworld"counter counter helloworld helloworld introduction