I have a dictionary
event_types={"as":0,"ah":0,"es":0,"eh":0,"os":0,"oh":0,"cs":0,"ch":0}
How can I replace a
by append
, s
by see
, h
by horse
, e
by exp
with a space in between.
Output something like:
{"append see":0,"append horse":0,"exp horse":0....}
Not sure if you can append or not, but you can do the following one liner:
>>> dict={}
>>> dict={"a":"b"}
>>> dict["aha"]=dict.pop("a")
>>> dict
{'aha': 'b'}
You can traverse the keys and change them according to your need.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With