【发布时间】:2016-08-04 21:59:40
【问题描述】:
如果我有这个:
>>> templ = "{aa} fd3443fds {bb} 543gfdgf {cc}"
>>> d1 = {"aa": "this is aa", "bb": "this is bb33", "cc": "this is cc5222"}
用“d1”中的相应值替换templ中{}中的值最简单的方法是什么,最好使用String的“format”函数?
【问题讨论】:
-
Joota,你的意思是
String还是str?我不知道String是什么。
标签: python python-3.x