擅长:python、mysql、java
<p>您需要在两个列表之间进行某种映射,否则您无法找出用什么替换什么。你可以用口述:</p>
<pre><code>t = 'The frnt tyre'
words = {
'front': ('frnt', 'frt'),
}
for word, repl in words.items():
for r in repl:
t = t.replace(r, word)
print t
</code></pre>
<p>结果:</p>
<pre><code>The front tyre
</code></pre>