What would be elegant/pythonic way to pass multiple string variables through a sub? I need to pass multiple varialbes to sub to replace string chunk that appears in every single one of them.
My working code which I want to avoid:
import re
txt = "aaa"
txt2 = "aaaCCC"
txt = re.sub(r'aaa', 'bbb', txt)
txt2 = re.sub(r'aaa', 'bbb', txt2)
print(txt)
print(txt2)