How to use a Translation Table to Replace Characters in Python
Python provides the ability to create Translation Tables.
First we create a Translation Table by calling str.maketrans(x, y, z)
, passing in our characters we want to translate from and to.
Then we apply our translate(table)
to a string using our newly created Translation Table.