Open this example in the interactive library
Source code
table = str.maketrans({'a': '4', 'e': '3'})
print('create'.translate(table))Sample output
cr34t3

Translate characters. A self-contained example using the Python standard library.
Open this example in the interactive library
table = str.maketrans({'a': '4', 'e': '3'})
print('create'.translate(table))cr34t3