Home >>Python List Methods
Python has a set of built-in methods for lists/arrays that you can use for array/lists.
Method | Description |
---|---|
append() | It is used to add an element at the end of the list. |
clear() | It is used to remove all the elements from the list. |
copy() | It is used to return a copy of the list. |
count() | It is used to return the number of elements with the specified value. |
extend() | It is used to add the elements of a list to the end of the current list. |
index() | It is used to return the index of the first element with the specified value. |
insert() | It is used to add an element at the specified position. |
pop() | It is used to remove the element at the specified position. |
remove() | It is used to remove the first item with the specified value. |
reverse() | It is used to reverse the order of the list. |
sort() | It is used to sort the list. |