Bases: _abcoll.MutableSequence
A list-like object with attributes.
Initialization
Parameters : |
|
---|
Return a deep copy.
Equivalent to copy.deepcopy(s).
Returns : |
|
---|
Examples
>>> s.copy()
Return the number of occurrences of a given value.
Parameters : |
|
---|---|
Returns : |
|
Examples
>>> s
[1, 2, 3, 2, 4, 2]
>>> s.count(1)
1
>>> s.count(2)
3
True if two instances are logically equal, False otherwise.
Parameters : |
|
---|---|
Returns : |
|
Return the first index of a given value.
Parameters : | value : start : int, optional stop : int, optional |
---|---|
Returns : | out : int |
Raises : |
|
Examples
>>> s
[1, 2, 3, 2, 4, 2]
>>> s.index(1)
1
>>> s.index(2, start=2)
3
>>> s.index(2, start=2, stop=4)
3
Insert an object before the given index in place.
Parameters : | index : int object : |
---|---|
Returns : | None |
Examples
>>> s
[1, 2, 3]
>>> s.insert(1, 'A')
>>> s
[1, 'A', 2, 3]