我有一个名为“mydict”的Python字典,其中包含数组,它看起来像这样:
mydict = dict(
one=['foo', 'bar', 'foobar', 'barfoo', 'example'],
two=['bar', 'example', 'foobar'],
three=['foo', 'example'])
我希望将所有出现的"example"替换为"someotherword"。
虽然我已经想到了几种方法,但是否有一种最符合Python风格的方法来实现这个目标?