Python Forum
A deciphering problem
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A deciphering problem
#7
It makes use of
https://docs.python.org/3/library/stdtyp....translate Wrote:str.translate(table)
Return a copy of the string in which each character has been mapped through the given translation table. The table must be an object that implements indexing via __getitem__(), typically a mapping or sequence. When indexed by a Unicode ordinal (an integer), the table object can do any of the following: return a Unicode ordinal or a string, to map the character to one or more other characters; return None, to delete the character from the return string; or raise a LookupError exception, to map the character to itself.

You can use str.maketrans() to create a translation map from character-to-character mappings in different formats.

See also the codecs module for a more flexible approach to custom character mappings.
Reply


Messages In This Thread
A deciphering problem - by Truman - Aug-14-2021, 08:35 PM
RE: A deciphering problem - by ibreeden - Aug-15-2021, 07:31 AM
RE: A deciphering problem - by DPaul - Aug-16-2021, 07:19 AM
RE: A deciphering problem - by ibreeden - Aug-16-2021, 05:43 PM
RE: A deciphering problem - by Yoriz - Aug-16-2021, 07:25 PM
RE: A deciphering problem - by Truman - Aug-16-2021, 07:53 PM
RE: A deciphering problem - by Yoriz - Aug-16-2021, 08:02 PM
RE: A deciphering problem - by DPaul - Aug-17-2021, 06:19 AM
RE: A deciphering problem - by jamesaarr - Aug-18-2021, 08:12 AM
RE: A deciphering problem - by ibreeden - Aug-17-2021, 09:08 AM
RE: A deciphering problem - by DPaul - Aug-17-2021, 09:47 AM
RE: A deciphering problem - by ibreeden - Aug-17-2021, 10:22 AM
RE: A deciphering problem - by ibreeden - Aug-18-2021, 02:11 PM
RE: A deciphering problem - by Yoriz - Aug-18-2021, 05:12 PM
RE: A deciphering problem - by DPaul - Aug-19-2021, 02:47 PM
RE: A deciphering problem - by Truman - Aug-21-2021, 03:28 PM
RE: A deciphering problem - by DPaul - Aug-22-2021, 09:16 AM
RE: A deciphering problem - by Yoriz - Aug-22-2021, 11:53 AM
RE: A deciphering problem - by ibreeden - Aug-23-2021, 09:27 AM
RE: A deciphering problem - by DPaul - Aug-23-2021, 04:00 PM
RE: A deciphering problem - by Yoriz - Aug-23-2021, 04:18 PM
RE: A deciphering problem - by ibreeden - Aug-23-2021, 05:03 PM
RE: A deciphering problem - by DPaul - Aug-23-2021, 05:24 PM
RE: A deciphering problem - by Yoriz - Aug-23-2021, 06:05 PM
RE: A deciphering problem - by DPaul - Aug-24-2021, 07:07 AM
RE: A deciphering problem - by ibreeden - Aug-24-2021, 02:58 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020