diff -r 0b576ab589c5 Doc/tutorial/datastructures.rst --- a/Doc/tutorial/datastructures.rst Sat Nov 12 14:37:11 2016 +0200 +++ b/Doc/tutorial/datastructures.rst Sat Nov 12 10:55:36 2016 -0500 @@ -60,11 +60,12 @@ Remove all items from the list. Equivalent to ``del a[:]``. -.. method:: list.index(x) +.. method:: list.index(x[, start[, end]]) :noindex: - Return the index in the list of the first item whose value is *x*. It is an - error if there is no such item. + Return zero-based index in the list of the first item whose value is *x*. + It is an error if there is no such item. Optional arguments ``start`` and + ``end`` are interpreted as in slice notation. .. method:: list.count(x) @@ -103,6 +104,8 @@ [66.25, 333, -1, 333, 1, 1234.5, 333] >>> a.index(333) 1 + >>> a.index(333, 2) # search for 333 starting at index 2 + 3 >>> a.remove(333) >>> a [66.25, -1, 333, 1, 1234.5, 333]