📅  最后修改于: 2022-03-11 14:48:19.910000             🧑  作者: Mango
mapping = {
'1': 'i',
'2': 'put',
'3': 'this',
'4': 'here',
}
sentence = ['1', '2', '3', '4']
newsentence = [mapping.get(word, word) for word in sentence]
# ['I', 'put', 'this', 'here']