If I want to use translate
on more than one unicode character like:
'banana'.translate({ord('ba'):u'cd'})
How can I do this? ord
works on only one character. So what can make this happen?
Note: The solution explained in How to replace multiple substrings of a string? is not a Python3 compatible solution. I tried to modify the iteritems
as per iteritems in Python but couldn't make it working. I am new to python I don't know how to make this work.