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 c461aa9 commit 8661e67Copy full SHA for 8661e67
1 file changed
Doc/library/stdtypes.rst
@@ -2546,6 +2546,18 @@ expression support in the :mod:`re` module).
2546
2547
Like :meth:`rfind` but raises :exc:`ValueError` when the substring *sub* is not
2548
found.
2549
+ For example:
2550
+
2551
+ .. doctest::
2552
2553
+ >>> 'spam, spam, spam'.rindex('eggs')
2554
+ Traceback (most recent call last):
2555
+ File "<stdin-0>", line 1, in <module>
2556
+ 'spam, spam, spam'.rindex('eggs')
2557
+ ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
2558
+ ValueError: substring not found
2559
2560
+ See also :meth:`index` and :meth:`find`.
2561
2562
2563
.. method:: str.rjust(width, fillchar=' ', /)
0 commit comments