Question
A list of string replacements in Python
Is there a far shorter way to write the following code?
my_string = my_string.replace('A', '1')
my_string = my_string.replace('B', '2')
my_string = my_string.replace('C', '3')
my_string = my_string.replace('D', '4')
my_string = my_string.replace('E', '5')
Note that I don't need those exact values replaced; I'm simply looking for a way to turn 5+ lines into fewer than 5
45 81990
45