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 0cc73ad commit 95e2ea3Copy full SHA for 95e2ea3
Doc/library/stdtypes.rst
@@ -2472,6 +2472,19 @@ expression support in the :mod:`re` module).
2472
after the separator. If the separator is not found, return a 3-tuple containing
2473
the string itself, followed by two empty strings.
2474
2475
+ For example:
2476
+
2477
+ .. doctest::
2478
2479
+ >>> 'Monty Python'.partition(' ')
2480
+ ('Monty', ' ', 'Python')
2481
+ >>> "Monty Python's Flying Circus".partition(' ')
2482
+ ('Monty', ' ', "Python's Flying Circus")
2483
+ >>> 'Monty Python'.partition('-')
2484
+ ('Monty Python', '', '')
2485
2486
+ See also :meth:`rpartition`.
2487
2488
2489
.. method:: str.removeprefix(prefix, /)
2490
0 commit comments