擅长:python、mysql、java
<p>像这样的怎么样?你知道吗</p>
<pre><code>words = {'esta': 'is', 'la': 'the', 'en': 'in', 'gato': 'cat', 'casa': 'house', 'el': 'the'}
def translate(sentence):
splitted_sentence = sentence.split()
return ' '.join([words[word] for word in splitted_sentence])
print(translate("el gato esta en la casa"))
>> the cat is in the house
</code></pre>