the first few steps real integer string 'some messageprint 'real= finteger=%dstring=% (realintegerstringprint 'real=% einteger=% dstring=% (realintegerstringthe output of print is stringspecified in terms of text and set of variables to be inserted in the text variables are inserted in the text at places indicated by after comes specification of the formattinge % (real number)% (integer)or % (stringthe format % means real number in decimal notationwith decimalswritten in field of width equal to characters the variant means that the number is written as compactly as possiblein decimal notationwith three decimals switching with or results in the scientific notationhere + or + writing % means that an integer is to be written in field of width equal to characters real numbers can also be specified with %gwhich is used to automatically choose between decimal or scientific notationfrom what gives the most compact output (typicallyscientific notation is appropriate for very small and very large numbers and decimal notation for the intermediate rangea typical example of when printf formatting is requiredarises when nicely aligned columns of numbers are to be printed suppose we want to print column of values together with associated function values td sin tin second column the simplest approach would be from math import sin dt unformatted print *dtg *sin(tprint tg *dtg *sin(tprint tg *dtg *sin(tprint tg with output (repeating the same set of statements multiple timesas done aboveis not good programming practice one should use for loopas explained later in section observe that the numbers in the columns are not nicely aligned using the printf syntax '% % (tgfor and gwe can control the width of each column and also the number of decimalssuch that the numbers in column are