0
どのテキストでも複数の単語を置き換えるのに問題があります。 phpのstrtr()のような関数が見つかりませんでした。 は、私はこのように行う必要があります。PythonはPHPのstrtr()のような機能を持っていますか?
text="I like apple and orange"
print(text) #output: "I like apple and orange"
dict={"apple":"orange", "orange":"apple"} # these words must replace
text=some_func(dict, text)
print(text) # output: "I like orange and apple"