【发布时间】:2015-12-13 21:56:13
【问题描述】:
我有一本字典
event_types={"as":0,"ah":0,"es":0,"eh":0,"os":0,"oh":0,"cs":0,"ch":0}
如何将a 替换为append、s 替换为see、h 替换为horse、e 替换为exp,并在两者之间使用空格。
输出类似:
{"append see":0,"append horse":0,"exp horse":0....}
【问题讨论】:
-
如果您的列表太短,您就不能删除您的条目并重新创建新条目吗?
-
@JulienBernu 比这更大。
标签: python string python-2.7 dictionary