s.index(x[, i[, j]]) will change the s ?

s7v7nislands s7v7nislands at gmail.com
Thu Sep 10 00:00:20 EDT 2009


hi all:
    what is the s.index() mean? does the index() change the s?
    In python2.6 doc (6.6.4. Mutable Sequence Types), Note 4:

Raises ValueError when x is not found in s. When a negative index is
passed as the second or third parameter to the index() method, the
list length is added, as for slice indices. If it is still negative,
it is truncated to zero, as for slice indices.

Changed in version 2.3: Previously, index() didn’t have arguments for
specifying start and stop positions.

who can give a example?  and why the s.remove() also point to note 4?
Is the document wrong?



More information about the Python-list mailing list