maketrans() - Returns a translation table to be used in translations

Given a string, replaces characters in that string with the specified "translation".  The translation is returned as a dictionary of translated characters.  The string specifying the characters to be replaced has to be the same length as the translation string.

Example

Python
src = 'Hi Marc!'
translation = src.maketrans('Marc', 'Kyra')
print(translation)
translated = src.translate(translation)
print(translated)

Output

{77: 75, 97: 121, 114: 114, 99: 97}
Hi Kyra!