'first=%slast=%smiddle=%sparts "first=slast=mmiddle=[' '' ']when more complex formatting is applied the two techniques approach parity in terms of complexityalthough if you compare the following with the format method call equivalents listed earlier you'll again find that the expressions tend to be bit simpler and more concisein python adding specific formatting '%- % ('spam' 'spam '% %- ('spam' spam '%(plat) %(kind)- sdict(plat=sys platformkind='laptop'win laptop floating-point numbers '% % ( ' + + '% % ( ' hex and octalbut not binary (see ahead'% % ( 'ff the format method has handful of advanced features that the expression does notbut even more involved formatting still seems to be essentially draw in terms of complexity for instancethe following shows the same result generated with both techniqueswith field sizes and justifications and various argument reference methodshardcoded references in both import sys 'my { [kind]: }format(sys{'kind''laptop'}'my laptop runs win 'my %(kind)- runs %(plat) sdict(kind='laptop'plat=sys platform'my laptop runs win in practiceprograms are less likely to hardcode references like this than to execute code that builds up set of substitution data ahead of time (for instanceto collect input form or database data to substitute into an html template all at oncewhen we account for common practice in examples like thisthe comparison between the format method and the expression is even more direct string fundamentals