I want to do more than one replacement in a single line. I am working with really complicated code that would benefit from this. I made a simple example of my problem below:
lines = ['Temp = 65 ; Temperature = degrees Farenheit',
'Mass = 15 ; Mass = Pounds'
]
lines2 = []
a = ['Farenheit','Celsius']
b = ['Pounds','Grams']
for s in lines:
linez = s.replace(a,b)
lines2.insert(0,linez)
print(lines2)
I want to be able to add more replacements in the future without having to make new for loops and empty lists.