called formatthat makes substitutions into places enclosed in braces for instance the example filehello_you pycreates and prints the same string as in hello_you py from the previous section'''hello to you''illustrates format with {in print person input('enter your name'greeting 'hello{}!format(personprint(greetingthere are several new ideas herefirst method calling syntax for objects is used you will see this very important modern syntax in more detail at the beginning of the next in object orientation (page all data in python are objectsincluding strings objects have special syntax for functionscalled methodsassociated with the particular type of object in particular str objects have method called format the syntax for methods has the object followed by period followed by the method nameand any further parameters in parentheses object methodname(parametersin the example abovethe object is the string 'hello {}!the method is named format there is one further parameterperson the string for the format method has special formwith braces embedded places where braces are embedded are replaced by the value of an expression taken from the parameter list for the format method there are many variations on the syntax between the braces in this case we use the syntax where the first (and onlylocation in the string with braces has substitution made from the first (and onlyparameter in the code abovethis new string is assigned to the identifier greetingand then the string is printed the identifier greeting was introduced to break the operations into clearer sequence of steps howeversince the value of greeting is only referenced onceit can be eliminated with the more concise versionperson input('enter your name'print('hello {}!format(person)consider the interview program suppose we want to add period at the end of the sentence (with no space before itone approach would be to combine everything with plus signs another way is printing with keyword sep='another approach is with string formatting using our grade school analogythe idea is to fill in the blanks in will interview at there are multiple places to substituteand the format approach can be extended to multiple substitutionseach place in the format string where there is '{}'the format operation will substitute the value of the next parameter in the format parameter list run the example file interview pyand check that the results from all three methods match '''compare print with concatenation and with format string ''applicant input("enter the applicant' name"interviewer input("enter the interviewer' name"time input("enter the appointment time"print(interviewer will interview applicant at time +'print(interviewerwill interview 'applicantat 'time'sep=''print('{will interview {at {format(interviewerapplicanttime)sometimes you want single stringbut not just for printing you can combine pieces with the operatorbut then all pieces must be strings or explicitly converted to strings an advantage of the format method is that it will convert types to string automaticallylike the print function here is another variant of our addition sentence exampleaddition pyusing the format method beginning with python