Skip to content

Commit df2492e

Browse files
committed
gh-106318: Add a successful example for str.index() method
1 parent 08a4a43 commit df2492e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Doc/library/stdtypes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2163,6 +2163,8 @@ expression support in the :mod:`re` module).
21632163

21642164
.. doctest::
21652165

2166+
>>> 'spam, spam, spam'.index('spam')
2167+
0
21662168
>>> 'spam, spam, spam'.index('eggs')
21672169
Traceback (most recent call last):
21682170
File "<python-input-0>", line 1, in <module>

0 commit comments

Comments
 (0)