data types both arguments must be the same length the str translate(method takes translation table as an argument and returns copy of its string with the characters translated according to the translation table here is how we could translate strings that might contain bengali digits to english digitstable "maketrans("\ {bengali digit zero}"\ {bengali digit one}\ {bengali digit two}"\ {bengali digit three}\ {bengali digit four}"\ {bengali digit five}\ {bengali digit six}"\ {bengali digit seven}\ {bengali digit eight}"\ {bengali digit nine}"" "print(" translate(table)prints print("\ {bengali digit two} \ {bengali digit four}"\ {bengali digit nine}translate(table)prints notice that we have taken advantage of python' string literal concatenation inside the str maketrans(call and inside the second print(call to spread strings over multiple lines without having to escape newlines or use explicit concatenation we called str maketrans(on an empty string because it doesn' matter what string it is called onit simply processes its arguments and returns translation table the str maketrans(and str translate(methods can also be used to delete characters by passing string containing the unwanted characters as the third argument to str maketrans(if more sophisticated character translations are requiredwe could create custom codec--see the codecs module documentation for more about this python has few other library modules that provide string-related functionality we've already briefly mentioned the unicodedata moduleand we'll show it in use in the next subsection other modules worth looking up are difflib which can be used to show differences between files or between stringsthe io module' io stringio class which allows us to read from or write to strings as though they were filesand the textwrap module which provides facilities for wrapping and filling strings there is also string module that has few useful constants such as ascii_letters and ascii_lowercase we will see examples of some of these modules in use in in additionpython provides excellent support for regular expressions in the re module-is dedicated to this topic string formatting with the str format(method |the str format(method provides very flexible and powerful way of creating strings using str format(is easy for simple casesbut for complex formatting we need to learn the formatting syntax the method requires