str.maketrans in python

Str.maketrans

It returns a translation table usable for str.translate and convert argument to number.It takes dictionary as input if only one…