[Solved] Translate a string using a character map [closed]
The built-in function you seem to be looking for is str.translate: S.translate(table [,deletechars]) -> string Return a copy of the string S, where all characters occurring in the optional argument deletechars are removed, and the remaining characters have been mapped through the given translation table, which must be a string of length 256 or None. … Read more