Consider a text file and 2 lists. In list_A there are some letters and in list_B some other letters. I want an algorithm to find the letters in the text which exist in list_A, and replaces them with letters with the same index from list_B. It finds and replaces them, but, each time it replaces it the previous result disappears.
I mean at last, I have the result of the last replacement in the print. How can I solve this problem? I mean I want a print in which all the letters are replaced, not just the last one.
what could be the problem with this loop:
for i in text:
if i in list_A:
p=text.replace(i, list_B[list_A.index(i)])
print(p)
maketrans+translate.p+=text.replace...?