I'm trying to create a script rewriting system so that after each iteration all A will change to B and all B will change to AB. The initial state is ABA so the first iteration should yield BABB but the code I have returns ABABAB. I'm really new to python as you can probably tell from my code below so if you could explain why what I'm doing is going so wrong that would be much appreciated as well
SRS = { 'a':'b', 'b':'ab'}
script = "aba"
for key in SRS:
script = script.replace(key,SRS[key])
print(script)