name="jack" age=24 s="name is {name} and age is {age}".format(**locals()) print s
运行结果如下:
name is jack and age is 24
希望本文所述对大家的Python程序设计有所帮助。