list.append (x)
Add an item to the end of the list.
list.extend (x)
Extend the list by appending all the items at the end of the list.
list.insert (i,x)
Insert an item at any given position within the list. The first argument 'i', is the index of the item before which you want to insert something. To insert something at the beginning of the list, you may type list.insert (0,x)
list.remove (x)
Remove the first item from the list whose value is 'x'. It is an error if there is no such item.
list.pop (i)
Remove any item from any given position (index) in the list. If no index is specified, it removes and returns the last element from the list.
list.index (x)
It returns a zero-based index in the list of the first item whose value is x. Raises an error of there is no such item as 'x'.
list.count (x)
Returns the number of times 'x' appears in the list
list.reverse ()
It reverses the items of the list.
list.sort ()
It sorts the items in the list.
最新回复