我有两个清单
list1 = ['a', 'b', 'c'] list2 = ['d', 'e', 'f']
我有一个带有随机文本的变量.
var = 'backout'
我想将list1中存在的变量中的所有字母转换为list2中的字母.
expectedOutput = 'edfkout'
有没有办法做到这一点?
python substitution python-2.7
python ×1
python-2.7 ×1
substitution ×1