We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5828e9b commit 4328d06Copy full SHA for 4328d06
1 file changed
Doc/library/stdtypes.rst
@@ -2847,7 +2847,9 @@ expression support in the :mod:`re` module).
2847
character-to-character mappings in different formats.
2848
2849
The following example uses a mapping to replace ``'a'`` with ``'X'``,
2850
- ``'b'`` with ``'Y'``, and delete ``'c'``::
+ ``'b'`` with ``'Y'``, and delete ``'c'``:
2851
+
2852
+ .. doctest::
2853
2854
>>> 'abc123'.translate({ord('a'): 'X', ord('b'): 'Y', ord('c'): None})
2855
'XY123'
0 commit comments