>>> "{a} love {b}.{c}".format(a="I", b="Fish", c="com") 'I love Fish.com' >>> '{0}{1:.2f}'.format('pi=',3.1415926) 'pi=3.14' 转载于:https://www.cnblogs.com/themost/p/6358890.html