'''two numeric inputsexplicit sum'' int(input("enter an integer") int(input("enter another integer")sum + sentence 'the sum of {and {is {format(xysumprint(sentenceconversion to strings was not needed in interview py (everything started out as string in addition pyhoweverthe automatic conversion of the integers to strings is useful so far there is no situation that requires format string instead of using other approaches sometimes format string provides shorter and simpler expression except where specifically instructed in an exercise for practiceuse whatever approach to combining strings and data that you like there are many elaborations to the fields in braces to control formatting we will look at one laterstring formats for float precision (page )where format strings are particularly useful technical pointsince braces have special meaning in format stringthere must be special rule if you want braces to actually be included in the final formatted string the rule is to double the braces'{{and '}}the example code formatbraces pyshown belowmakes setstr refer to the string 'the set is { , the initial and final doubled braces in the format string generate literal braces in the formatted string'''illustrate braces in formatted string '' setstr 'the set is {{{}{}}format(abprint(setstrthis kind of format string depends directly on the order of the parameters to the format method there is another approach with dictionarythat was used in the first sample programmadlib pyand will be discussed more in dictionaries and string formatting (page the dictionary approach is probably the best in many casesbut the count-based approach is an easier startparticularly if the parameters are just used oncein order optional elaboration with explicitly numbered entries imagine the format parameters numbered in orderstarting from in this case and the number of the parameter position may be included inside the bracesso an alternative to the last line of interview py is (added in example file interview py)print('{ will interview { at { format(interviewerapplicanttime)this is more verbose than the previous versionwith no obvious advantage howeverif you desire to use some of the parameters more than oncethen the approach with the numerical identification with the parameters is useful every place the string includes '{ }'the format operation will substitute the value of the initial parameter in the list wherever '{ }appearsthe next format parameter will be substituted predict the results of the example file arith py shown belowif you enter and then check yourself by running it in this case the numbers referring to the parameter positions are necessary they are both repeated and used out of order'''fancier format string example with parameter identification numbers -useful when some parameters are used several times '' int(input('enter an integer') int(input('enter another integer')formatstr '{ { { }{ { { equations formatstr format(xyx+yx*yprint(equations input and output