a= 'eeekkksksksk' print a.replace('e','s').replace('s','k') #kkkkkkkkkkkk change={"e":"s","k":'@',"s":"!"} a_new=''.join(change[i] for i in a) print(a_new) ''' sss@@@!@!@!@ '''