Strings are immutable in python.
So text.replacereturns a string, but does not change the original string.
Given that you should not actually use it text.replace, as you will have to change line 24 (or probably 26, see below). Most likely, you can create a translation table to make all changes at once and use it string.translate.
, string.maketrans ( "y" "z"? , , , "", 'b'). translate.