How Would I change this function from changing only the letters to change the entire word? I believe I have to change the ch in the code (for ch in newString: ) but I don't know what to.
replacements = {
'TOMORROW': 'TMR',
'ABOUT': 'BOUT',
'PLEASE': 'PLZ',
'BEFORE': 'B4'
}
def replace(newString):
old,new = [],[]
for ch in newString:
if replacements.get(ch):
newString = newString.replace(ch, replacements.get(ch))
print(newString)