string formatting in python formatting of strings has changednow it more logical and is more flexible formatting can be done using the format(method or the sign(old stylein format string the string can contain literal text or replacement fields delimited by braces {and each replacement field may contains either the numeric index of positional argument or the name of keyword argument syntax str format(*args**kwargsbasic formatting '{{}format('example''one''example one'{{}format('pie'' ''pie below example allows re-arrange the order of display without changing the arguments '{ { }format('pie'' '' piepadding and aligning strings value can be padded to specific length #padding charactercan be space or special character '{: }format('python''python '{:> }format('python'python'{:<{} }format('python', 'python '{:*< }format('python''python******