>>> element = 'silver' >>> number = 47 >>> 'Element {number} is {element}'.format(**locals()) 'Element 47 is silver'这里通过 映射操作符'**'将当前还在操作范围内的element,number传递给函数locals()