Python List Methods
Python lists come with various built-in methods that allow you to manipulate and interact with lists
Method | Description |
---|---|
append() | Adds an element to the end of the list |
clear() | Removes all items from the list |
copy() | Returns a shallow copy of the list |
count() | Returns the count of the number of items passed as an argument |
extend() | Adds all elements of a list to another list |
index() | Returns the index of the first matched item |
insert() | Inserts an item at the defined index |
pop() | Returns and removes an element at the given index |
remove() | Removes an item from the list |
reverse() | Reverse the order of items in the list |
sort() | Sort items in a list in ascending order |